Skip to content

Conversation

@ericspod
Copy link
Member

@ericspod ericspod commented Jun 17, 2024

Description

This fixes the version of Numpy to be less than 2.0 so that we can get a working setup guaranteed. Numpy 2.0 isn't supported yet by MONAI and will need a number of changes to be compatible.

This is only sometimes a problem because a number of dependencies we have require Numpy<2.0. When these are absent however, such as with minimal installs, Numpy 2.0 can be installed and causes problems. This is a temporary fix until we have worked out an update that's compatible with versions before and after 2.0.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
@ericspod ericspod requested review from KumoLiu and Nic-Ma June 17, 2024 15:50
@ericspod ericspod mentioned this pull request Jun 17, 2024
7 tasks
@ericspod
Copy link
Member Author

@wyli @pxLi @YanxuanLiu @KumoLiu @Nic-Ma I need one of you to initiate the Blossom tests to let this through. Other PRs can't pass because certain tests are failing if they install Numpy 2.0. We should update things to be compatible but this is the temporary fix we need for now.

@Nic-Ma
Copy link
Contributor

Nic-Ma commented Jun 18, 2024

/build

@Nic-Ma Nic-Ma merged commit 08d5728 into Project-MONAI:dev Jun 19, 2024
KumoLiu pushed a commit to KumoLiu/MONAI that referenced this pull request Jun 24, 2024
### Description

This fixes the version of Numpy to be less than 2.0 so that we can get a
working setup guaranteed. Numpy 2.0 isn't supported yet by MONAI and
will need a number of changes to be compatible.

This is only sometimes a problem because a number of dependencies we
have require Numpy<2.0. When these are absent however, such as with
minimal installs, Numpy 2.0 can be installed and causes problems. This
is a temporary fix until we have worked out an update that's compatible
with versions before and after 2.0.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
KumoLiu added a commit that referenced this pull request Jun 25, 2024
### Description


### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
Co-authored-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
@MattTheCuber
Copy link
Contributor

Is there plans to make MONAI support Numpy v2 in the near future?

@ericspod
Copy link
Member Author

Hi @MattTheCuber we are discussing developing a dependency update policy at #8303 so we can balance keeping older versions for those that need them against updating requirements appropriately. For Numpy 2 if you don't need to use any dependencies which do not work with it, you can install MONAI then upgrade the version of Numpy that gets installed. That should work as we've made MONAI compatible but added this exclusion to ensure the install process would produce a valid configuration.

@MattTheCuber
Copy link
Contributor

Ok, I don't need numpy v2 yet. I just wanted to see when we can upgrade our company's project to the latest version of the library as MONAI is the last limiting dependency. We use uv for dependency controls, so upgrading numpy after installing the deps is not ideal, we will continue waiting. Thank you for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants