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
71 stars 37 forks source link

Numpy 1.25 support - deprecation error with 'R_curve' #60

Closed pietro31700 closed 3 months ago

pietro31700 commented 3 months ago

Hello,

Since Numpy 1.25.0 a previous warned behavior has become deprecated. In particular in fitting/fitted_model.py the lines:

if all_vals[i] in all_keys:

and

if all_vals[i] == "dirichlet":

raise an exception if a custom _Rcurve is specified, because of the 2D array nature of the _Rcurve value.

I can suggest to put a if not all_keys[i] == 'R_curve' containing this two previous if. There shouldn't be any loss of generality because of the unique meaning of the _Rcurve key

For further information: https://numpy.org/doc/stable/release/1.25.0-notes.html

ACCarnall commented 3 months ago

Thanks for this, would you like to submit a pull request with the changes or should I go ahead and make them?

pietro31700 commented 3 months ago

Ok, I'll submit the pull request

ACCarnall commented 3 months ago

Fixed by #61 , I will release a new version of the code including this soon.

ACCarnall commented 3 months ago

Just to say that's v1.0.4 with this update included available via pypi now, thanks for the help!