Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy 2 compatability #67

Closed
3 tasks done
joeloskarsson opened this issue Aug 8, 2024 · 4 comments
Closed
3 tasks done

Numpy 2 compatability #67

joeloskarsson opened this issue Aug 8, 2024 · 4 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@joeloskarsson
Copy link
Collaborator

joeloskarsson commented Aug 8, 2024

Nerual-lam is at the moment not completely compatible with the new release of numpy 2. At the moment the requirements specification includes numpy 2, so that is what will be installed when installing neural-lam.

While the upgrade to numpy 2 compatability is likely not huge, it is also not urgent. It is still good to first prevent this issue by changing the dependency specifier, and then we can put it on the roadmap to upgrade.

Things TODO:

  • Change requirement specifier to prevent installs of numpy 2
  • Put upgrade on roadmap
  • Finish numpy 2 compatability upgrade
@joeloskarsson joeloskarsson added bug Something isn't working enhancement New feature or request labels Aug 8, 2024
@joeloskarsson
Copy link
Collaborator Author

One error message we get with numpy 2 is "Alias np.float_ has been removed. Use np.float64 instead." (from @sadamov)

joeloskarsson added a commit that referenced this issue Aug 8, 2024
## Describe your changes

Nerual-lam is at the moment not completely compatible with the new
release of numpy 2. This PR changes the numpy version in
requirements.txt to < 2.0.0.

## Issue Link

#67

## Type of change

- [x] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 📖 Documentation (Addition or improvements to documentation)

## Checklist before requesting a review

- [x] My branch is up-to-date with the target branch - if not update
your fork with the changes from the target branch (use `pull` with
`--rebase` option if possible).
- [x] I have performed a self-review of my code
- [x] I have given the PR a name that clearly describes the change,
written in imperative form
([context](https://www.gitkraken.com/learn/git/best-practices/git-commit-message#using-imperative-verb-form)).
- [x] I have requested a reviewer and an assignee (assignee is
responsible for merging)

## Checklist for reviewers

Each PR comes with its own improvements and flaws. The reviewer should
check the following:
- [x] the code is readable
- [x] the code is well tested
- [x] the code is documented (including return types and parameters)
- [x] the code is easy to maintain

## Author checklist after completed review

- [x] I have added a line to the CHANGELOG describing this change, in a
section
  reflecting type of change (add section where missing):
  - *added*: when you have added new functionality
  - *changed*: when default behaviour of the code has been changed
  - *fixes*: when your contribution fixes a bug

## Checklist for assignee

- [x] PR is up to date with the base branch
- [x] the tests pass
- [x] author has added an entry to the changelog (and designated the
change as *added*, *changed* or *fixed*)
- Once the PR is ready to be merged, squash commits and merge the PR.
@joeloskarsson
Copy link
Collaborator Author

@sadamov Do you remember any more information about where you ran into Alias np.float_ has been removed. Use np.float64 instead.? I managed to run training and testing successfully on CPU with numpy 2.0.1. Was that error from some of the pre-processing scripts? (I have not tried them yet)

@sadamov
Copy link
Collaborator

sadamov commented Aug 19, 2024

I have run all pre-processing scripts and the model training with the latest env from #32. Tested both on CPU/GPU to be sure, no issues. So this must mean that I was previously working with a dirty environment. Sometimes I managed to install numpy<2.0.0 with mamba and numpy>2.0.0 with pip on top. Probably some libraries in my env were still built against numpy=1.2.6 as a result. I apologies for wasting our time and suggest to close this issue. I will update my comment in #37 and reference this issue.

@joeloskarsson
Copy link
Collaborator Author

joeloskarsson commented Aug 20, 2024

Ok, great! I still think it was good to look into this and make sure that everything works with 2.0.

For completion:

@sadamov sadamov self-assigned this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants