Unclear Error Message if module other than bilby is specified
I had made a typo in my .prior
file by calling bbilby
instead of bilby
. The error message returned was very unclear.
18:33 bilby_pipe INFO : Setting prior-file to bbh.prior
18:33 bilby_pipe INFO : Setting trigger time 0
18:33 bilby_pipe INFO : Setting segment duration 4s
18:33 bilby_pipe INFO : Generating injection file injections.json from prior=bbh.prior, n_injection=100, generation_seed=1234
Traceback (most recent call last):
File "/home1/aditya.vijaykumar/src/miniconda3/bin/bilby_pipe_create_injection_file", line 11, in <module>
load_entry_point('bilby-pipe==0.3.11', 'console_scripts', 'bilby_pipe_create_injection_file')()
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/site-packages/bilby_pipe-0.3.11-py3.7.egg/bilby_pipe/create_injections.py", line 325, in main
generation_seed=args.generation_seed,
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/site-packages/bilby_pipe-0.3.11-py3.7.egg/bilby_pipe/create_injections.py", line 308, in create_injection_file
injection_creator.generate_injection_file(filename, extension)
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/site-packages/bilby_pipe-0.3.11-py3.7.egg/bilby_pipe/create_injections.py", line 260, in generate_injection_file
injection_dataframe = self.get_injection_dataframe()
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/site-packages/bilby_pipe-0.3.11-py3.7.egg/bilby_pipe/create_injections.py", line 219, in get_injection_dataframe
inj_df = pd.DataFrame.from_dict(self.priors.sample(self.n_injection))
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/site-packages/bilby_pipe-0.3.11-py3.7.egg/bilby_pipe/input.py", line 829, in priors
self._priors = self._get_priors()
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/site-packages/bilby_pipe-0.3.11-py3.7.egg/bilby_pipe/input.py", line 857, in _get_priors
priors = prior_class(filename=self.prior_file)
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/site-packages/bilby/gw/prior.py", line 393, in _init_
conversion_function=conversion_function)
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/site-packages/bilby/core/prior/dict.py", line 39, in _init_
self.from_file(filename)
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/site-packages/bilby/core/prior/dict.py", line 152, in from_file
self.from_dictionary(prior)
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/site-packages/bilby/core/prior/dict.py", line 209, in from_dictionary
cls = getattr(import_module(module), cls, cls)
File "/home1/aditya.vijaykumar/src/miniconda3/lib/python3.7/importlib/_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'bbilby'
Maybe this error message could be made friendlier? (Suggested by @colm.talbot)
Edited by Colm Talbot