mpi-astronomy / gdr3apcal

Tool for Gaia DR3 astrophysical parameter re-calibration
https://mpi-astronomy.github.io/gdr3apcal
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

pip install does not install configuration.yaml #2

Closed amaliestokholm closed 1 year ago

amaliestokholm commented 2 years ago

If I run this on python3.9 or python3.10:

python3 -m venv .venv && .venv/bin/pip install git+https://github.com/mpi-astronomy/gdr3apcal
.venv/bin/python -c 'import gdr3apcal; calib = gdr3apcal.GaiaDR3_GSPPhot_cal()'

Then I get the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/.venv/lib/python3.10/site-packages/gdr3apcal/calibration.py", line 115, in __init__
    self._configuration = _read_configuration(configuration_file)
  File "/tmp/.venv/lib/python3.10/site-packages/gdr3apcal/calibration.py", line 18, in _read_configuration
    with open(fname, 'r') as conf:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/.venv/lib/python3.10/site-packages/gdr3apcal/configuration.yaml'

...But if instead I run gdr3apcal directly from a git checkout:

git clone https://github.com/mpi-astronomy/gdr3apcal &&
cd gdr3apcal &&
python3 -m venv .venv && .venv/bin/pip install -U wheel pip && .venv/bin/pip install astropy pandas joblib requests sklearn &&
PYTHONPATH=src .venv/bin/python -c 'import gdr3apcal; calib = gdr3apcal.GaiaDR3_GSPPhot_cal()'

Then I get no error. It seems like pip install doesn't copy over the configuration.yaml file. There are no yaml files in /tmp/.venv/lib/python3.10/site-packages/gdr3apcal.

This might be the same issue as in #1.

Rumpelstil commented 1 year ago

Thanks for the explanation! Seems like the problem with the missing "configuration.yaml" when following the instructions to install with pip is still present. Edit: the missing file can be found in src/gdr3apcal and could be copied over by hand after the (partial) pip install