Skip to content

Fix numpy 2.0 issue - #744

Merged
smribet merged 8 commits into
py4dstem:devfrom
cophus:dev
Aug 1, 2026
Merged

smribet merged 8 commits into
py4dstem:devfrom
cophus:dev

Conversation

@cophus

@cophus cophus commented Aug 1, 2026

Copy link
Copy Markdown
Member

Update py4dstem so that colab tutorials work smoothly. Contains several other small fixes.

cophus and others added 8 commits October 22, 2024 16:01
scipy's peak_prominences returns length-1 arrays for a single peak;
numpy >= 2.0 no longer allows assigning a size-1 array to a scalar
element, so find_peaks_single_pattern raised ValueError. Index into the
prominence arrays explicitly (works identically on numpy 1.x). With this
fix the full tutorial API surface (disk detection, calibration, polar
peaks/flowlines, ACOM, CrystalPhase, StrainMap, save/read) runs under
numpy 2.5 with no downgrade.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@smribet
smribet merged commit 6b1195d into py4dstem:dev Aug 1, 2026
6 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.

2 participants