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

Make uncertainties compatible with numpy 2.0 #245

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

eendebakpt
Copy link
Contributor

In numpy 2.0 the numpy.core was renamed to numpy._core. Is this PR we change the imports in the uncertainties package to work with both numpy 2.0 and numpy 1.x.

Copy link

codecov bot commented Jul 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 48.31%. Comparing base (35ab5e8) to head (4e0b451).

Files Patch % Lines
uncertainties/unumpy/core.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #245      +/-   ##
==========================================
- Coverage   48.34%   48.31%   -0.03%     
==========================================
  Files          12       12              
  Lines        1903     1902       -1     
==========================================
- Hits          920      919       -1     
  Misses        983      983              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

newville
newville previously approved these changes Jul 4, 2024
Copy link
Member

@newville newville left a comment

Choose a reason for hiding this comment

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

@eendebakpt Thanks! I agree.

Separately: I wonder if we should explicitly test with both numpy 1.2something and numpy 2.0.... but that should not be necessary here, as this probably does really warrant a bugfix release for numpy2 users.

uncertainties/unumpy/core.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@wshanks wshanks left a comment

Choose a reason for hiding this comment

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

Looks good now!

@wshanks
Copy link
Collaborator

wshanks commented Jul 4, 2024

@newville We effectively do test on numpy 1 and 2 because we test on Python 3.8 and numpy 2.0 only supports Python 3.9+.

We may want to set deprecation warnings as test failures, or maybe just deal with the numpy.matrix pending deprecation warnings. I think I missed this deprecation warning about numpy.core amongst all the numpy.matrix pending deprecation warnings when I tested with numpy 2.0 before.

@newville
Copy link
Member

newville commented Jul 4, 2024

@reneeotten @eendebakpt Thanks!

@wshanks good point about Py38 being pinned to Numpy1. I am okay with leaving this as it is.
I know of a few third-party packages that I use in downstream projects that have not yet released Numpy2-compatible code. I suspect it will take several months to safely assume that everything works with Numpy2. I'd hate for uncertainties (or lmfit) to either be the "stuck on Numpy1" bottleneck or require Numpy2 too early.

@reneeotten
Copy link
Collaborator

please squash the commits and update the commit message.

@newville newville dismissed reneeotten’s stale review July 4, 2024 19:17

requests were satisfied.

@newville newville merged commit 4b309a6 into lmfit:master Jul 4, 2024
16 of 18 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.

4 participants