HDF5 saving error (and subsequent error while reading) -- maybe related to the metadata?
The HDF5 encoder sometimes has trouble encoding stuff (i think specifically stuff in the metadata):
23:08 bilby ERROR :
Saving the data has failed with the following message:
No conversion path for dtype: dtype('<U63')
Data has been dumped to ../../../../../../../private/var/folders/qt/rxjvm_j566v9qn7g754s1v9hzb3p7f/T/pytest-of-avaj0001/pytest-69/test_end_to_end0/result/bbh_injection_result.pkl.
23:08 bilby INFO : Summary of results:
nsamples: 1
ln_noise_evidence: -16419.781
ln_evidence: -16324.042 +/- 1.764
ln_bayes_factor: 95.739 +/- 1.764
Example ini:
accounting = ligo.dev.o3.cbc.pe.lalinference
label = bbh_injection
outdir = outdir_bbh_injection
detectors = [H1, L1]
duration = 4
sampler = dynesty
sampler-kwargs = {'nlive': 5, 'nact': 1, 'dlogz':30}
trigger_time = 0
injection = True
injection-dict = {"mass_1": 50, 'mass_2': 45, 'a_1': 0, 'a_2': 0, 'tilt_1': 0, 'tilt_2': 0,
'phi_12': 0, 'phi_jl': 0, 'luminosity_distance': 1000, 'dec': -0.2, 'ra': 1.4,
'theta_jn': 0.2, 'psi': 0, 'phase': 0, 'geocent_time': 0}
gaussian-noise = True
n-simulation = 1
n-parallel = 1
request-cpus = 4
osg = True
prior-dict = {
mass_1 = 50.0
mass_2 = 45.0
a_1 = 0.0
a_2 = 0.0
tilt_1 = 0.0
tilt_2 = 0.0
phi_12 = 0.0
phi_jl = 0.0
luminosity_distance = bilby.gw.prior.UniformComovingVolume(name='luminosity_distance', minimum=1e2, maximum=5e3, unit='Mpc')
dec = -0.2
ra = 1.4
theta_jn = Sine(name='theta_jn')
psi = 0.0
phase = 0.0
geocent_time = 0.0
}
The HDF file is still saved, but when a user tries to read it in:
../../../bilby/bilby-master/bilby/core/result.py:95: in read_in_result
result = Result.from_hdf5(filename=filename)
../../../bilby/bilby-master/bilby/core/result.py:476: in from_hdf5
return cls(**data)
../../../bilby/bilby-master/bilby/core/result.py:399: in __init__
self.priors = priors
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <bilby.core.result.Result object at 0x12e0b0130>
priors = {'mass_1': DeltaFunction(peak=50.0, name=None, latex_label=None, unit=None), 'mass_2': DeltaFunction(peak=45.0, name=N...me=None, latex_label=None, unit=None), 'geocent_time': DeltaFunction(peak=0.0, name=None, latex_label=None, unit=None)}
@priors.setter
def priors(self, priors):
if isinstance(priors, dict):
if isinstance(priors, PriorDict):
self._priors = priors
else:
self._priors = PriorDict(priors)
if self.parameter_labels is None:
> self.parameter_labels = [self.priors[k].latex_label for k in
self.search_parameter_keys]
E TypeError: 'NoneType' object is not iterable
../../../bilby/bilby-master/bilby/core/result.py:543: TypeError
Ran with
>>> bilby.__version__
'2.0.1.dev21+g507d93c8.d20230315'
>>> bilby_pipe.__version__
'1.0.9.dev0+g383f28b.d20230315'
Edited by Avi Vajpeyi