IPython problem when getting keys from PulsarParametersPy object
With LALSuite v7.6, a problem seems to have been introduced with the PulsarParametersPy
object when accessing its keys
attribute. Bizarrely, this problem only seems to manifest if using the object in an ipython session, but not through a script that is run directly with python.
As an example, suppose you have a .par
file called pulsar.par
containing:
PSRJ J0927+1258
RAJ 09:27:00.0
DECJ 12:58:00.0
F0 100.1
F1 -2.3e-16
You can read this in within ipython with:
from lalpulsar.PulsarParametersWrapper import PulsarParametersPy
p = PulsarParametersPy("pulsar.par")
if you then try to access:
p.keys()
then terminal then hangs (or sometimes issues Aborted (core dumped)
).
However, if you have a script called, say printkeys.py
, that contains:
from lalpulsar.PulsarParametersWrapper import PulsarParametersPy
p = PulsarParametersPy("pulsar.par")
print(p.keys())
and you run it with python printkeys.py
, it will work.
Both these work when using LALSuite v7.5, so the change must have been introduced recently.
I suspect this is some SWIG memory handling error that has issues with when the keys()
method goes through the SWIG-wrapped C PulsarParameters
linked list (that is stored internally in the Python object as self._pulsarparameters
).
@karl-wette do you have any idea what the issue may be?