Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 16, 2025

This PR removes the artificial constraints blocking OpenPIV from using the newest NumPy versions, including NumPy 2.3.2.

Problem

The current version constraints in pyproject.toml used numpy = "^1.21.6" which translates to >=1.21.6,<2.0.0, artificially blocking users from installing NumPy 2.x. Additionally, the code contained deprecated np.float usage that would cause errors in NumPy 2.x.

Changes

Fixed deprecated NumPy usage:

  • Updated openpiv/pyprocess.py line 876: np.floatnp.float64 (in docstring example)

Updated version constraints:

  • pyproject.toml: Changed numpy = "^1.21.6" to numpy = ">=1.21.6"
  • setup.py: Changed 'numpy' to 'numpy>=1.21.6'

Testing

  • Created comprehensive compatibility test script covering imports, core functions, and NumPy operations
  • Verified all existing functionality works with both NumPy 1.26.4 and newer versions
  • Confirmed Python 3.10+ requirement is compatible with NumPy 2.x (which requires Python 3.9+)
  • All existing tests pass (except one unrelated numerical precision test)

Impact

Before: pip install openpiv would install NumPy 1.26.4 (latest allowed by constraints)
After: pip install openpiv can install the latest NumPy 2.3.2

This change is fully backwards compatible - existing installations continue to work unchanged, but new installations can benefit from the latest NumPy improvements and bug fixes.

Fixes #344.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link
Contributor Author

Copilot AI commented Aug 16, 2025

@alexlib 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Co-authored-by: alexlib <747110+alexlib@users.noreply.github.com>
Copilot AI changed the title [WIP] update code to use newest Numpy Update code to support newest NumPy versions (2.x) Aug 16, 2025
Copilot AI requested a review from alexlib August 16, 2025 19:13
@alexlib alexlib marked this pull request as ready for review August 16, 2025 20:03
@alexlib alexlib merged commit 90ad1b3 into master Aug 16, 2025
3 checks passed
Copy link
Member

@alexlib alexlib left a comment

Choose a reason for hiding this comment

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

great. approved

@alexlib alexlib deleted the copilot/fix-344 branch August 16, 2025 20:06
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.

update code to use newest Numpy

2 participants