missing astropy dependence for lalpulsar wheels (and gwpy?)
@duncanmmacleod @adam-mercer The problem, already discussed with @karl-wette who suggested to ask you:
$ python3 -m venv test-venv
$ source test-venv/bin/activate
$ pip install --upgrade pip
$ pip install lalsuite
$ python
>>> from lalpulsar.PulsarParametersWrapper import PulsarParametersPy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nfshome/store02/users/david.keitel/test-venv/lib64/python3.6/site-packages/lalpulsar/PulsarParametersWrapper.py", line 32, in <module>
from astropy import units as u
ModuleNotFoundError: No module named 'astropy'
Some analysis from @matthew-pitkin :
Looking at the build spec (https://git.ligo.org/lscsoft/lalsuite/-/blob/master/lalpulsar/lalpulsar.spec.in) it does have astropy as a build dependency, so I'm surprised that this isn't an explicit dependecy with the lalsuite releases.
I suppose it's because it's not listed in the "install_requires" section of the setup.py.in file https://git.ligo.org/lscsoft/lalsuite/-/blob/master/wheel/setup.py.in#L187. On the line above that we could maybe add to the "extras_require" with:
extras_require={
'lalinference': ['gwpy', 'gwdatafind'],
'lalpulsar': ['astropy'],
},
I don't know if there's a reason for not doing this. That said, gwpy itself has astropy as a requirement https://github.com/gwpy/gwpy/blob/master/requirements.txt, so I'd have thought it would get picked up through that!
On Matt's last point, gwpy doesn't seem to get pulled in either:
$ pip list
Package Version
------------------- -------
cffi 1.14.1
cryptography 3.0
cycler 0.10.0
importlib-resources 3.0.0
kiwisolver 1.2.0
lalsuite 6.75
ligo-segments 1.2.0
lscsoft-glue 2.0.0
matplotlib 3.3.0
numpy 1.19.1
Pillow 7.2.0
pip 20.2.1
pycparser 2.20
pyOpenSSL 19.1.0
pyparsing 2.4.7
python-dateutil 2.8.1
scipy 1.5.2
setuptools 39.2.0
six 1.15.0
zipp 3.1.0