ACCarnall / bagpipes

Bagpipes is a state of the art code for generating realistic model galaxy spectra and fitting these to spectroscopic and photometric observations. Users should install with pip, not by cloning the repository.
http://bagpipes.readthedocs.io
GNU General Public License v3.0
81 stars 42 forks source link

Fix deprecated numpy behavior when using R_curve #61

Closed pietro31700 closed 9 months ago

pietro31700 commented 9 months ago

Since Numpy 1.25.0 a previous warning behavior has become deprecated.

In particular '==' and 'in' have been redefined to match the Python meaning when there are arrays to the left of the operators.

This broke a part of the code where the value of the R_curve array (which is a 2D array) was checked if it was equal to the name of another key in the fit parameters or equal to "dirichlet".

This commit skip these comparison when the key is R_curve.

Solve #60

ACCarnall commented 9 months ago

Shouldn't lines 98-110 also receive an additional indent now to also only be executed if the new if statement on line 78 is fulfilled?

pietro31700 commented 9 months ago

Yes! I'm sorry. Those lines are the central point of this pull request. Now I tested it and it should work.

ACCarnall commented 9 months ago

No problem, thanks very much for helping out.