Skip to content

General bug fixes and deprecation updates#24

Open
CarterDW wants to merge 8 commits into
masterfrom
fastptfixes
Open

General bug fixes and deprecation updates#24
CarterDW wants to merge 8 commits into
masterfrom
fastptfixes

Conversation

@CarterDW

@CarterDW CarterDW commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Updated numpy, scipy, matplotlip requirements, removed deprecated np.trapz as well as np.rowstack for np.trapezoid and np.vstack, as well as updated .toml, readme, and .yml to reflect new changes

…trapz as well as np.rowstack for np.trapezoid and np.vstack, as well as updated .toml, readme, and .yml to reflect new changes
Copilot AI review requested due to automatic review settings June 23, 2026 16:05

Copilot AI left a comment

Copy link
Copy Markdown

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 modernizes the project’s Python/scientific-stack baseline by raising minimum dependency versions (NumPy/SciPy/Matplotlib), bumping the minimum supported Python version, and updating code to avoid NumPy APIs that are deprecated/removed in newer NumPy releases.

Changes:

  • Raised minimum versions for numpy, scipy, and matplotlib, and increased requires-python to >=3.9.
  • Replaced deprecated NumPy APIs (np.trapz, np.row_stack) with supported equivalents (np.trapezoid, np.vstack) across the codebase.
  • Updated examples and CI configuration to reflect the new baseline (with a noted CI version issue).

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
requirements.txt Updates minimum dependency versions for end users installing via requirements file.
README.md Removes outdated note about old NumPy compatibility.
pyproject.toml Updates requires-python and project dependencies to match new minimum versions.
fastpt/utils/OV.py Replaces np.row_stack with np.vstack for NumPy 2.x compatibility.
fastpt/utils/matter_power_spt.py Removes legacy/commented trapz import reference.
fastpt/utils/kPol.py Replaces np.row_stack with np.vstack for NumPy 2.x compatibility.
fastpt/utils/J_table.py Replaces np.row_stack with np.vstack for NumPy 2.x compatibility.
fastpt/rsd/RSD.py Replaces np.row_stack with np.vstack for NumPy 2.x compatibility.
fastpt/IA/IA_tt.py Replaces np.row_stack with np.vstack for NumPy 2.x compatibility.
fastpt/IA/IA_ta.py Replaces np.row_stack with np.vstack for NumPy 2.x compatibility.
fastpt/IA/IA_gb2.py Replaces np.row_stack with np.vstack for NumPy 2.x compatibility.
fastpt/IA/IA_ctbias.py Replaces np.row_stack with np.vstack for NumPy 2.x compatibility.
fastpt/IA/IA_ct.py Replaces np.row_stack with np.vstack for NumPy 2.x compatibility.
fastpt/IA/IA_ABD.py Replaces np.row_stack with np.vstack for NumPy 2.x compatibility.
fastpt/core/FPTHandler.py Fixes docstring to reference save_instance() as the producer for load_instance().
fastpt/core/FASTPT.py Replaces np.trapz with np.trapezoid in sig4 computation.
fastpt/core/FASTPT_simple.py Replaces np.trapz with np.trapezoid in bias integral computation.
fast_pt.egg-info/requires.txt Updates generated metadata dependency versions (should not be version-controlled).
examples/IA_ABD_plot.py Clarifies LaTeX dependency for usetex=True.
examples/hello_fastpt.py Updates example to use save_instance() API.
examples/fastpt_example.py Updates example to retrieve sig4 from one_loop_dd_bias return tuple.
examples/fastpt_example_nonlin_bias.py Changes plotting behavior (now interactive), impacting headless execution.
.github/workflows/ci.yml Updates Actions versions and dependency install steps; adds Python 3.14 (problematic).

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

Comment thread fast_pt.egg-info/requires.txt Outdated
Comment thread examples/fastpt_example_nonlin_bias.py
Comment thread examples/fastpt_example_nonlin_bias.py Outdated
@CarterDW CarterDW changed the title Updated numpy, scipy, matplotlip requirements, removed deprecated np.… General bug fixes and deprecation updates Jun 23, 2026
@CarterDW

Copy link
Copy Markdown
Collaborator Author

@copilot re review

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown

@copilot re review

I re-reviewed the current branch. I didn’t find any additional actionable changes from the prior review threads, so no new code changes were needed in this pass.

@CarterDW CarterDW self-assigned this Jun 23, 2026
Comment thread tests/test_benchmarks.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These skipif decorators skip the benchmark comparisons on ARM64, which means those terms (IA_ta, IA_ct, IA_mix, the RSD ones) have no regression check at all on Apple Silicon. I compared the regenerated baselines against master — the drift is small (~1e-5 absolute, just NumPy 1.x→2.x floating-point differences), so could we loosen the tolerance instead of skipping? Something like np.allclose(..., rtol=1e-3, atol=1e-4) would pass on all platforms while still catching real breakage.
Also, the skip conditions look off: sys.version_info <= (3, 14) is true for basically every current Python, so combined with or arm64 these skip almost everywhere. And a couple of the reason strings say "3.13" while the check is <= (3, 14).

@athoyas athoyas Jul 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While tracing the sig4 indexing change through one_loop_dd_bias, I noticed something unrelated in _get_Ps2s2 (in FASTPT.py). Not caused by this PR, but might be worth addressing. The function computes and returns its result in a local variable named Pd2s2 rather than Ps2s2. Looks like a copy-paste leftover from _get_Pd2s2 directly above it. Functionally it seems harmless — the value is cached under the correct "Ps2s2" label and returned normally, so callers get the right result. Worth renaming for clarity (I didn't verify the formula itself).

@CarterDW

Copy link
Copy Markdown
Collaborator Author

Differs from marcpaterno PR by also updating np.rowstack and fixing a few pytest failings and other various bookkeeping issues

CarterDW added 2 commits July 14, 2026 14:50
…th no fail, looser tolerance with an xfail warning, and if it passes neither it gives an assertionerror
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