Skip to content

pycbc_inference_models_stat fails when waveform generation fails #5223

@yi-fan-wang

Description

@yi-fan-wang

I was trying to use pycbc_inference_models_stat to reconstruct the parameters that had been marginalized , but encountered the following error:

"""
Traceback (most recent call last):
  File "/usr/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/work/yifanwang/ecc/pe/env-2025-10-11/lib/python3.11/site-packages/pycbc/inference/models/__init__.py", line 49, in _call_global_model
    return _global_instance(*args, **kwds)  # pylint:disable=not-callable
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/yifanwang/ecc/pe/env-2025-10-11/bin/pycbc_inference_model_stats", line 106, in callmodel
    rec = model.reconstruct(seed=iteration)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/yifanwang/ecc/pe/env-2025-10-11/lib/python3.11/site-packages/pycbc/inference/models/tools.py", line 795, in reconstruct
    rec['loglr'] = loglr[xl]
                   ~~~~~^^^^
TypeError: 'float' object is not subscriptable
"""

This was accompanied by a large number of waveform generation failure messages. My suspicion is that loglr might be a None object because none of the waveform generations succeeded. This may indicate the parameter reconstruction doesn't properly deal with waveform generation failures. The complete log can be found here.

@ahnitz Do you have any idea how to fix it?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions