I seem to not be able to load certain functions after the2023-01-24 version update. On my machine, when I run from psrchive import Archive_load I get ImportError: cannot import name 'Archive_load' from 'psrchive' (/opt/python/3.9/envs/pulsar/lib/python3.10/site-packages/psrchive.py) which was not happening in previous updates.
I should also mention that despite this I am able to run import psrchive just fine, but then the Archive_load function seems to be missing if I try to access it that way. When I run
import psrchive; psrchive.Archive_load(filename)I getAttributeError: modile 'psrchive' has no attribute 'Archive_load'hi Jacob, sorry for the trouble, I will take a look today. I assume you are using the conda-forge package?
Hi Paul,
Yes, that’s correct, we are using conda-forge.
Jacob
On Mon, Feb 13, 2023 at 11:07 Paul Demorest demorest@users.sourceforge.net
wrote:
Related
Bugs: #475
Just investigated a bit, it appears that
psrchive.Archive.load()works with the new version in place ofpsrchive.Archive_load(). So that can be used as a short-term workaround. This is almost certainly due to a swig version change, I will work on making a new package that supports the previous syntax (either in place of or in addition to the new).Got it. Thanks for checking!
On Mon, Feb 13, 2023 at 18:07 Paul Demorest demorest@users.sourceforge.net
wrote:
Related
Bugs: #475
One more bit of info for the record, this change appeared in swig 4.1.0. From https://www.swig.org/Release/CHANGES:
I'll get a new build going soon that enables this option for backwards compatibility.
OK there is a new conda-forge package (still v2023.01.24, build number 4) that enables the relevant option and restores
Archive_load(). Useful to note thatArchive.load()also works, so that may be a more "future-proof" choice, and any modifications made in the past day don't necessarily need to be reverted.I'll leave this ticket open for now since this should eventually be addressed in psrchive configure as well, to automatically enable
-flatstaticmethodwhen swig version >= 4.1.0.