Skip to content

Fix upgrade to numpy 2.0 issues#902

Merged
psavery merged 1 commit intomasterfrom
fix-numpy-2.0-issues
Mar 3, 2026
Merged

Fix upgrade to numpy 2.0 issues#902
psavery merged 1 commit intomasterfrom
fix-numpy-2.0-issues

Conversation

@psavery
Copy link
Copy Markdown
Collaborator

@psavery psavery commented Mar 3, 2026

Overview

  1. Numpy no longer allows assigning 1D array into a scalar element. We have to extract a matching value before assigning.
  2. np.trapz was deprecated (removed in 2.4) - replace with np.trapezoid

Affected Workflows

All

Documentation Changes

None

1. Numpy no longer allows assigning 1D array into a scalar element. We
   have to extract a matching value before assigning.
2. np.trapz was deprecated (removed in 2.4) - replace with np.trapezoid

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@psavery psavery requested a review from ZackAttack614 March 3, 2026 19:47
Copy link
Copy Markdown
Collaborator

@ZackAttack614 ZackAttack614 left a comment

Choose a reason for hiding this comment

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

Glad to see us moving forward with numpy changes!

@psavery psavery merged commit c6ce6e5 into master Mar 3, 2026
9 checks passed
@psavery psavery deleted the fix-numpy-2.0-issues branch March 3, 2026 20:36
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 37.50000% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.62%. Comparing base (f40f031) to head (da7153f).
⚠️ Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
hexrd/powder/wppf/peakfunctions.py 50.00% 3 Missing ⚠️
hexrd/hedm/ipfcolor/sphere_sector.py 0.00% 2 Missing ⚠️
hexrd/powder/wppf/LeBailCalibration.py 0.00% 2 Missing ⚠️
hexrd/core/material/crystallography.py 75.00% 1 Missing ⚠️
hexrd/powder/wppf/WPPF.py 0.00% 1 Missing ⚠️
hexrd/powder/wppf/amorphous.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #902      +/-   ##
==========================================
+ Coverage   69.41%   69.62%   +0.21%     
==========================================
  Files         148      149       +1     
  Lines       22590    22596       +6     
==========================================
+ Hits        15680    15732      +52     
+ Misses       6910     6864      -46     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants