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

fix:numpy 2.2.2 type compatibility issue #2616

Merged
merged 8 commits into from
Feb 5, 2025

Conversation

anj20
Copy link
Contributor

@anj20 anj20 commented Feb 2, 2025

Purpose of PR?:Resolves numpy 2.2.2 compatibility issue by replacing deprecated float_ type with float64

Fixes #2615

Does this PR introduce a breaking change?
No, this is a minor type compatibility fix that should not break existing functionality

If the changes in this PR are manually verified, list down the scenarios covered::
Screenshot from 2025-02-02 21-14-39

Checklist:

  • Bug fix. Fixes numpy for 2.x not compatible #2615
  • New feature (Non-API breaking changes that adds functionality)
  • PR Title follows the convention of <type>: <subject>
  • Commit has unit tests

@ReimarBauer
Copy link
Member

Please add a pinning of numpy in the meta.yaml so that users which update don't stay with the wrong version.

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current MSS release is 9.3.0 which needs an older numpy and the branch for this is stable

next major MSS release 10.0.0 needs numpy > 2.0 and the branch for this is develop

The change would install an older version than 2.0.

@@ -86,6 +86,7 @@ requirements:
- flask-login
- pysaml2
- libxmlsec1 # [not win]
- numpy <2.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fix is for the next major 10.0.0, so we want here >=2 and also the codechanges needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the changes

@anj20 anj20 requested a review from ReimarBauer February 3, 2025 08:33
@ReimarBauer
Copy link
Member

ReimarBauer commented Feb 4, 2025

@anj20 please rebase to develop, it is currently out. of sync, you maybe need to sync your develop beforehand.

Merge attempt failed
Head branch is out of date. Review and try the merge again.

@anj20
Copy link
Contributor Author

anj20 commented Feb 4, 2025

@anj20 please rebase to develop, it is currently out. of sync, you maybe need to sync your develop beforehand.

Merge attempt failed Head branch is out of date. Review and try the merge again.

I have rebase.

@@ -133,7 +133,7 @@ def omega_to_w(omega, p, t):
(32 * units.km, 228.65 * units.K, 868.019 * units.Pa, -0.0028 * units.K / units.m),
(47 * units.km, 270.65 * units.K, 110.906 * units.Pa, 0 * units.K / units.m),
(51 * units.km, 270.65 * units.K, 66.9389 * units.Pa, 0.0028 * units.K / units.m),
(71 * units.km, 214.65 * units.K, 3.95642 * units.Pa, float("NaN") * units.K / units.m)
(71 * units.km, 214.65 * units.K, 3.95642 * units.Pa, np.nan * units.K / units.m)
Copy link
Member

@ReimarBauer ReimarBauer Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally recommended is to use np.nan when working with NumPy arrays and float("NaN") when working with built-in Python types.

This is likly the reason why May has used float("NaN") here.

It is not the only place where we have the string notation. When that gets changed then always.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think float("NaN") is used only once in the develop branch.
Do I need to revert back the change in this file ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you maybe need to do a regex lookup, I think I mentioned on slack, demodata

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked @joernu76 about the changes here, but no answer to that question yet.

@ReimarBauer
Copy link
Member

we see failing tests because of read timeout

@ReimarBauer ReimarBauer merged commit 549f272 into Open-MSS:develop Feb 5, 2025
8 of 11 checks passed
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.

numpy for 2.x not compatible
2 participants