General bug fixes and deprecation updates#24
Conversation
…trapz as well as np.rowstack for np.trapezoid and np.vstack, as well as updated .toml, readme, and .yml to reflect new changes
There was a problem hiding this comment.
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, andmatplotlib, and increasedrequires-pythonto>=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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@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. |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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).
|
Differs from marcpaterno PR by also updating np.rowstack and fixing a few pytest failings and other various bookkeeping issues |
…th no fail, looser tolerance with an xfail warning, and if it passes neither it gives an assertionerror
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