Nightly tests are failing
The nightly tests are failing because three examples are run in "test mode", I'm not sure I understand what this does exactly, but it seems to lead to the posterior containing samples with log_likelihood=-inf
.
Specifically, we get samples with m1 < m2 which means that when we try to reconstruct the marginalised parameters we get waveforms which are None
and it fails with the following trace.
My question is, how useful is this testing mode? Can't we just construct a test which runs p.e. with very few live points which will still finish in a few minutes and give meaningful output.
@gregory.ashton @moritz.huebner
self = <test.gw_example_test.Test testMethod=test_examples>
def test_examples(self):
""" Loop over examples to check they run """
examples = ['examples/injection_examples/fast_tutorial.py',
'examples/injection_examples/marginalized_likelihood.py',
'examples/open_data_examples/GW150914.py',
]
for filename in examples:
print("Testing {}".format(filename))
> execfile(filename)
test/gw_example_test.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/conda/lib/python3.7/site-packages/past/builtins/misc.py:82: in execfile
exec_(code, myglobals, mylocals)
examples/injection_examples/marginalized_likelihood.py:72: in <module>
conversion_function=bilby.gw.conversion.generate_all_bbh_parameters)
bilby/core/sampler/__init__.py:186: in run_sampler
conversion_function=conversion_function)
bilby/core/result.py:981: in samples_to_posterior
data_frame = conversion_function(data_frame, likelihood, priors)
bilby/gw/conversion.py:697: in generate_all_bbh_parameters
likelihood=likelihood, priors=priors)
bilby/gw/conversion.py:661: in _generate_all_cbc_parameters
samples=output_sample, likelihood=likelihood)
bilby/gw/conversion.py:1027: in generate_posterior_samples_from_marginalized_likelihood
signal_polarizations=signal_polarizations)
bilby/gw/conversion.py:1080: in generate_time_sample_from_marginalized_likelihood
signal = ifo.get_detector_response(signal_polarizations, sample)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Interferometer(name='H1', power_spectral_density=PowerSpectralDensity(psd_file='/builds/lscsoft/bilby/bilby/gw/noise_c...76571388889, elevation=142.554, xarm_azimuth=125.9994, yarm_azimuth=215.9994, xarm_tilt=-0.0006195, yarm_tilt=1.25e-05)
waveform_polarizations = None
parameters = {'a_1': 0.4, 'a_2': 0.3, 'dec': -1.2108, 'geocent_time': 1126259639.413, ...}
def get_detector_response(self, waveform_polarizations, parameters):
""" Get the detector response for a particular waveform
Parameters
-------
waveform_polarizations: dict
polarizations of the waveform
parameters: dict
parameters describing position and time of arrival of the signal
Returns
-------
array_like: A 3x3 array representation of the detector response (signal observed in the interferometer)
"""
signal = {}
> for mode in waveform_polarizations.keys():
E AttributeError: 'NoneType' object has no attribute 'keys'
bilby/gw/detector.py:1271: AttributeError