Skip to content

Fix NumPy 2.0+ compatibility: replace deprecated trapz with trapezoid - #14

Merged
dfeen87 merged 3 commits into
mainfrom
copilot/fix-program-bugs
Feb 13, 2026
Merged

Fix NumPy 2.0+ compatibility: replace deprecated trapz with trapezoid#14
dfeen87 merged 3 commits into
mainfrom
copilot/fix-program-bugs

Conversation

Copilot AI commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

NumPy 2.0 removed the deprecated np.trapz function, causing runtime failures across simulations and analysis modules. All instances replaced with np.trapezoid.

Changes

Core fixes (6 occurrences across 5 files):

  • theory/dynamics.py - memory kernel integration
  • analysis/cp_divisibility.py - BLP measure calculation
  • analysis/non_markovianity.py - BLP/RHP measure calculations (2×)
  • simulations/resonance_statistics.py - resonance-time weights (2×)

Housekeeping:

  • Added .gitignore for __pycache__ and build artifacts
  • Removed committed bytecode files

Example

# Before (fails on NumPy 2.0+)
memory_int = np.trapz(integrand, times, axis=0)

# After
memory_int = np.trapezoid(integrand, times, axis=0)

Function signature and numerical behavior identical - pure compatibility fix.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 13, 2026 19:23
Co-authored-by: dfeen87 <158860247+dfeen87@users.noreply.github.com>
Co-authored-by: dfeen87 <158860247+dfeen87@users.noreply.github.com>
@dfeen87
dfeen87 marked this pull request as ready for review February 13, 2026 19:27
@dfeen87
dfeen87 merged commit 65bfea2 into main Feb 13, 2026
6 of 7 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI changed the title [WIP] Fix bugs in program execution Fix NumPy 2.0+ compatibility: replace deprecated trapz with trapezoid Feb 13, 2026
@dfeen87
dfeen87 deleted the copilot/fix-program-bugs branch February 13, 2026 19:27
Copilot AI requested a review from dfeen87 February 13, 2026 19:27
Copilot stopped work on behalf of dfeen87 due to an error February 13, 2026 19:27
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