Scheduled tests failing: gw_example_test.py
https://git.ligo.org/lscsoft/bilby/-/jobs/567308
@moritz.huebner I have a sneaking suspicion due to
> self._rescale_indexes = [keys.index(element) for element in self.sorted_keys_without_fixed_parameters]
E ValueError: 'mass_ratio' is not in list
that this has something to do with the MRs that have been put in recently, would you have a few minutes to look at this?
Designs
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Gregory Ashton added Bug label
added Bug label
- Developer
Hi,
I was about to raise a new issue as
GW150914_advanced.py
throws an early error but it is the same bug as that above:$ python GW150914_advanced.py [...] 13:54 bilby INFO : Search parameters: 13:54 bilby INFO : mass_ratio = Uniform(minimum=0.125, maximum=1, name='mass_ratio', latex_label='$q$', unit=None, boundary='reflective') 13:54 bilby INFO : chirp_mass = Uniform(minimum=25, maximum=35, name='chirp_mass', latex_label='$\\mathcal{M}$', unit='$M_{\\odot}$', boundary='reflective') 13:54 bilby INFO : a_1 = Uniform(minimum=0, maximum=0.99, name='a_1', latex_label='$a_1$', unit=None, boundary='reflective') 13:54 bilby INFO : a_2 = Uniform(minimum=0, maximum=0.99, name='a_2', latex_label='$a_2$', unit=None, boundary='reflective') 13:54 bilby INFO : tilt_1 = Sine(name='tilt_1', latex_label='$\\theta_1$', unit=None, minimum=0, maximum=3.141592653589793, boundary='reflective') 13:54 bilby INFO : tilt_2 = Sine(name='tilt_2', latex_label='$\\theta_2$', unit=None, minimum=0, maximum=3.141592653589793, boundary='reflective') 13:54 bilby INFO : phi_12 = Uniform(minimum=0, maximum=6.283185307179586, name='phi_12', latex_label='$\\Delta\\phi$', unit=None, boundary='periodic') 13:54 bilby INFO : phi_jl = Uniform(minimum=0, maximum=6.283185307179586, name='phi_jl', latex_label='$\\phi_{JL}$', unit=None, boundary='periodic') 13:54 bilby INFO : luminosity_distance = PowerLaw(alpha=2, minimum=50, maximum=2000, name='luminosity_distance', latex_label='$d_L$', unit='Mpc', boundary=None) 13:54 bilby INFO : dec = Cosine(name='dec', latex_label='$\\mathrm{DEC}$', unit=None, minimum=-1.5707963267948966, maximum=1.5707963267948966, boundary='reflective') 13:54 bilby INFO : ra = Uniform(minimum=0, maximum=6.283185307179586, name='ra', latex_label='$\\mathrm{RA}$', unit=None, boundary='periodic') 13:54 bilby INFO : theta_jn = Sine(name='theta_jn', latex_label='$\\theta_{JN}$', unit=None, minimum=0, maximum=3.141592653589793, boundary='reflective') 13:54 bilby INFO : psi = Uniform(minimum=0, maximum=3.141592653589793, name='psi', latex_label='$\\psi$', unit=None, boundary='periodic') 13:54 bilby INFO : phase = Uniform(minimum=0, maximum=6.283185307179586, name='phase', latex_label='$\\phi$', unit=None, boundary='periodic') 13:54 bilby INFO : geocent_time = Uniform(minimum=1126259460.4, maximum=1126259464.4, name='geocent_time', latex_label='$t_c$', unit=None, boundary=None) 13:54 bilby INFO : mass_1 = Constraint(minimum=10, maximum=80, name='mass_1', latex_label='$m_1$', unit=None) 13:54 bilby INFO : mass_2 = Constraint(minimum=10, maximum=80, name='mass_2', latex_label='$m_2$', unit=None) 13:54 bilby INFO : Single likelihood evaluation took 3.971e-03 s 0it [00:00, ?it/s]13:54 bilby INFO : Using sampler Dynesty with kwargs {'bound': 'multi', 'sample': 'rwalk', 'verbose': True, 'periodic': None, 'reflective': None, 'check_point_delta_t': 600, 'nlive': 512, 'first_update': None, 'walks': 100, 'npdim': None, 'rstate': None, 'queue_size': None, 'pool': None, 'use_pool': None, 'live_points': None, 'logl_args': None, 'logl_kwargs': None, 'ptform_args': None, 'ptform_kwargs': None, 'enlarge': 1.5, 'bootstrap': None, 'vol_dec': 0.5, 'vol_check': 8.0, 'facc': 0.2, 'slices': 5, 'update_interval': 307, 'print_func': <bound method Dynesty._print_func of <bilby.core.sampler.dynesty.Dynesty object at 0x11a667d68>>, 'dlogz': 0.1, 'maxiter': None, 'maxcall': None, 'logl_max': inf, 'add_live': True, 'print_progress': True, 'save_bounds': False, 'n_effective': None, 'maxmcmc': 5000, 'nact': 5} No version information file '.version' found 13:54 bilby INFO : Checkpoint every n_check_point = 10000 13:54 bilby INFO : Using dynesty version 0.9.5.3 Traceback (most recent call last): File "GW150914_advanced.py", line 122, in <module> conversion_function=bilby.gw.conversion.generate_all_bbh_parameters) File "/Users/marcarene/projects/python/bilby/bilby/core/sampler/__init__.py", line 176, in run_sampler result = sampler.run_sampler() File "/Users/marcarene/projects/python/bilby/bilby/core/sampler/dynesty.py", line 234, in run_sampler self.kwargs['nlive'])) File "/Users/marcarene/projects/python/bilby/bilby/core/sampler/base_sampler.py", line 448, in get_initial_points_from_prior theta = self.prior_transform(unit) File "/Users/marcarene/projects/python/bilby/bilby/core/sampler/dynesty.py", line 541, in prior_transform return self.priors.rescale(self._search_parameter_keys, theta) File "/Users/marcarene/projects/python/bilby/bilby/core/prior.py", line 642, in rescale self._update_rescale_keys(keys) File "/Users/marcarene/projects/python/bilby/bilby/core/prior.py", line 651, in _update_rescale_keys self._rescale_indexes = [keys.index(element) for element in self.sorted_keys_without_fixed_parameters] File "/Users/marcarene/projects/python/bilby/bilby/core/prior.py", line 651, in <listcomp> self._rescale_indexes = [keys.index(element) for element in self.sorted_keys_without_fixed_parameters] ValueError: 'mass_1' is not in list
A quick look a the variables here gives:
ipdb> self.sorted_keys_without_fixed_parameters ['mass_ratio', 'chirp_mass', 'mass_1', 'mass_2', 'a_1', 'a_2', 'tilt_1', 'tilt_2', 'phi_12', 'phi_jl', 'luminosity_distance', 'dec', 'ra', 'theta_jn', 'psi', 'phase', 'geocent_time'] ipdb> keys ['mass_ratio', 'chirp_mass', 'a_1', 'a_2', 'tilt_1', 'tilt_2', 'phi_12', 'phi_jl', 'luminosity_distance', 'dec', 'ra', 'theta_jn', 'psi', 'phase', 'geocent_time']
Knowing that the
keys
comes fromsampler._search_parameter_keys
andprior.sorted_keys_without_fixed_parameters
is set from theprior._resolve_conditions()
method.Also isn't it strange that
mass_1
andmass_2
appear withmass_ratio
andchirp_mass
in the search parameters listed by the logger?Let me know if I can help !
- Maintainer
Changing https://git.ligo.org/lscsoft/bilby/blob/master/bilby/core/prior.py#L672 to
return [key for key in self.sorted_keys if not isinstance(self[key], (Constraint, DeltaFunction))]
looks promising. That example samples now although I'm not sure if it's doing the correct thing yet.
- Gregory Ashton mentioned in merge request !676 (merged)
mentioned in merge request !676 (merged)
- Moritz Huebner created merge request !677 (merged) to address this issue
created merge request !677 (merged) to address this issue
- Moritz Huebner mentioned in merge request !677 (merged)
mentioned in merge request !677 (merged)
- Moritz Huebner mentioned in commit 7b8a9dca
mentioned in commit 7b8a9dca
- Moritz Huebner closed via merge request !676 (merged)
closed via merge request !676 (merged)
- Moritz Huebner mentioned in commit 996f250d
mentioned in commit 996f250d