Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

fitmodel uses an old version of numpy #18

Closed
RuthVis opened this issue Nov 25, 2024 · 1 comment · Fixed by #19
Closed

fitmodel uses an old version of numpy #18

RuthVis opened this issue Nov 25, 2024 · 1 comment · Fixed by #19
Assignees

Comments

@RuthVis
Copy link

RuthVis commented Nov 25, 2024

I'm getting this error on running fitmodel:

AttributeError: module 'numpy' has no attribute 'product'

And it's true, numpy no longer seems to use "product". It seems to be "prod", now.

@mslugocki mslugocki self-assigned this Jan 8, 2025
@mslugocki mslugocki linked a pull request Jan 8, 2025 that will close this issue
@mslugocki
Copy link
Owner

Hi @RuthVis,

Appreciate raising the issue.

Short answer:

  1. Pull latest version of BayesFit (v2.4.1)
  2. Create virtual environment for BayesFit via venv
  3. Install requirements via pip install -r requirements.txt

Long answer:

To provide some additional context, indeed the newest Numpy versions of 2.x flavor really does warrant the major number change from 1.x. The developers completely modified the Numpy API compared to version 1.x, and it would require significant effort to modify BayesFit to be compatible with these newest versions and ensure everything is functioning as expected.

All things considered, I have updated the requirements.txt to provide an upper bound for the Numpy version that is compatible with BayesFit. Unfortunately, providing these bounds within the setup.py via install_requires can lead to some unexpected behavior (i.e., multiple version of the same module being installed). Therefore, I have opted to leave it up to users to install the requirements via the requirements.txt using the command pip install -r requirements.txt within a virtual environment. I have run the unit tests for BayesFit version 2.4.1, and using this installation method within a virtual environment, everything runs as expected (i.e., all unit tests pass).

The newest BayesFit version (v2.4.1) has been pushed to PYPI: https://pypi.org/project/bayesfit/2.4.1/#description

Hope this helps ✌️

Kind Regards,
M

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants