Unable to read prior files that have parentheses in the latex label
When trying to load a prior file with version 0.5.2 that has the following parameter log10_E0 = Uniform(name='log10_E0', minimum=47, maximum=54, latex_label=r'$\log(E_{0})$')
, I am now getting a new error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sylvia.biscoveanu/.local/lib/python2.7/site-packages/bilby-0.5.2-py2.7.egg/bilby/core/prior.py", line 42, in __init__
self.from_file(filename)
File "/home/sylvia.biscoveanu/.local/lib/python2.7/site-packages/bilby-0.5.2-py2.7.egg/bilby/core/prior.py", line 131, in from_file
prior[key] = cls.from_repr(args)
File "/home/sylvia.biscoveanu/.local/lib/python2.7/site-packages/bilby-0.5.2-py2.7.egg/bilby/core/prior.py", line 682, in from_repr
kwargs = cls._split_repr(string)
File "/home/sylvia.biscoveanu/.local/lib/python2.7/site-packages/bilby-0.5.2-py2.7.egg/bilby/core/prior.py", line 699, in _split_repr
args[ii] = ','.join([args[ii], args[ii + 1]]).strip()
IndexError: list index out of range
I think this is because the _split_repr
function can't handle latex labels that have parentheses. I don't think having parentheses in the label is super uncommon, so we should come up with a fix for this.