BASTAcode / BASTA

BASTA: The BAyesian STellar Algorithm
https://basta.readthedocs.io/
MIT License
21 stars 3 forks source link

Bug fixes for numpy & distutils #58

Closed mr-asher closed 1 week ago

mr-asher commented 1 week ago

BASTA currently fails to run on Python 3.12.3 when following the documentation.

Cloning the BASTA repo, setting up a virtual environement, then following the instructions at https://basta.readthedocs.io/en/latest/running.html fails for the following reasons:

and the following warning:

disutils was used to import the strtobool function. A copy of this function has been added to utils_general.py and is used instead.

np.unicode_ has been changed to np.str_ as advised by Numpy.

numpy.histogram was used to access the private function _hist_bin_fd which is deprecated by numpy. This function has been coped into the codebase directly instead. This might not be the best way to address this error. Changing the code to allow numpy to automate this calculation with something like hist, bin_edges = np.histogram(data, bins="fd") might be more maintainable but hasn't been implemented due to my lack of knowledge about the science requirements.

label=f"Best fit $\ell={l}$", code causes a warning error about improperly escaped characters. This has been changed to label=f"Best fit $\ell={l}$" which fixes the warning but might cause other issues I'm not aware of. This PR should be rejected if this is the case and I'll remove this part of the PR and submit again.