Skip to content

Fix AUTC integration on NumPy < 2.0#269

Merged
neuronflow merged 1 commit into
mainfrom
fix-autc-numpy-compat
Jun 15, 2026
Merged

Fix AUTC integration on NumPy < 2.0#269
neuronflow merged 1 commit into
mainfrom
fix-autc-numpy-compat

Conversation

@Hendrik-code

Copy link
Copy Markdown
Collaborator

panoptica_result.py used np.trapezoid, which only exists in NumPy >= 2.0, while the project declares numpy>=1.22. Resolve np.trapezoid / np.trapz at import so Area-Under-Threshold-Curve works across the whole supported NumPy range. Without this, the AUTC and statistics tests fail on NumPy 1.x.

panoptica_result.py used np.trapezoid, which only exists in NumPy >= 2.0, while
the project declares numpy>=1.22. Resolve np.trapezoid / np.trapz at import so
Area-Under-Threshold-Curve works across the whole supported NumPy range. Without
this, the AUTC and statistics tests fail on NumPy 1.x.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Hendrik-code Hendrik-code self-assigned this Jun 12, 2026
@Hendrik-code Hendrik-code marked this pull request as ready for review June 12, 2026 20:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Area-Under-Threshold-Curve (AUTC) integration compatibility across the project’s declared NumPy support range (numpy>=1.22) by avoiding direct use of np.trapezoid (NumPy 2.0+ only) and falling back to np.trapz on NumPy 1.x.

Changes:

  • Add a module-level _trapezoid alias that resolves to np.trapezoid when available, otherwise np.trapz.
  • Update AUTC integration to call the resolved _trapezoid function instead of np.trapezoid directly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aymuos15

Copy link
Copy Markdown
Collaborator

LGTM, do not think we need that big of a comment tho

@neuronflow neuronflow requested a review from ErikGro June 12, 2026 20:56
@neuronflow neuronflow merged commit 218faaf into main Jun 15, 2026
14 checks passed
@neuronflow neuronflow deleted the fix-autc-numpy-compat branch June 15, 2026 22:00
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.

5 participants