Skip to content

Conversation

@richardotis
Copy link
Collaborator

@richardotis richardotis commented Jun 18, 2024

Adds build-time and runtime support for NumPy 2.0. This version is C-API compatible with NumPy 1.x, so we set a build-time requirement for >=2.0 while retaining support for 1.x. This compatibility guarantee allows us to deprecate the usage of oldest-supported-numpy per the recommendation of those authors.

NumPy 2.0 does not support Python 3.8, but these changes do not directly impact our ability to support py38 on NumPy 1.x. (It is probably overdue for pycalphad to drop py38 support, but that can be done separately from here.)

Two minor and backwards-compatible fixes for runtime are needed and also added here: np.float_ is renamed to np.float64 and np.complex_ is renamed to np.complex128. (Complex number arrays are used for certain tests.)

See also:

Checklist

  • If any dependencies have changed, the changes are reflected in the
    • setup.py (runtime requirements)
    • pyproject.toml (build requirements)
    • requirements-dev.txt (build and development requirements)

@richardotis richardotis added the dependencies Pull requests that update a dependency file label Jun 18, 2024
@github-actions
Copy link

@github-actions github-actions bot temporarily deployed to pull request June 18, 2024 22:24 Inactive
@richardotis richardotis changed the title FIX/BLD: NumPy 2.0 Support MAINT/BLD: NumPy 2.0 Support Jun 18, 2024
@richardotis richardotis requested a review from bocklund June 18, 2024 23:40
@codecov
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

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

Project coverage is 90.45%. Comparing base (1c79c0c) to head (82f5485).

Files Patch % Lines
pycalphad/model.py 0.00% 2 Missing ⚠️
pycalphad/core/utils.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #530      +/-   ##
===========================================
- Coverage    90.47%   90.45%   -0.03%     
===========================================
  Files           50       50              
  Lines         7878     7878              
===========================================
- Hits          7128     7126       -2     
- Misses         750      752       +2     

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

@richardotis richardotis merged commit 25cf9c4 into develop Jun 24, 2024
@richardotis richardotis deleted the compat-numpy2 branch June 24, 2024 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants