Conversation
…ix numba py.typed comment - TaylorF2_aligned_inplace now reads params_intrinsic.chi_postnewtonian instead of re-deriving the PN reduced spin inline; the manager was already computing it and the removed IMRPhenomD module was its only reader. Waveform output is bit-identical. - test_binary_load asserts that chi_s, chi_a, chi_1z, chi_2z, chi_eff and chi_postnewtonian recovered from the packed chi_postnewtonian_norm match the test inputs, so chi_postnewtonian_reference is now load-bearing. - Correct the pyrefly rationale comments: numba ships py.typed since 0.66; it stays ignored only because it is not installed in the hook env.
numba ships py.typed since 0.66, so install numba>=0.66 in the pyrefly hook environment and drop it from [tool.pyrefly].ignore-missing-imports. The only errors real numba types surface are eight `for ... in prange(...)` not-iterable errors, all already covered by existing `# type: ignore[not-iterable]` comments; the hook stays at 0 errors.
Pyright infers prange(...) as range from numba's __new__ and never flags these loops, so the generic `# type: ignore[not-iterable]` was only needed by pyrefly and showed up as an unnecessary ignore under pyright's reportUnnecessaryTypeIgnoreComment. Switch the eight loops to `# pyrefly: ignore[not-iterable]`, which pyright does not inspect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Targets
dev. Follow-up to #51, carrying review fixes that were written for it but not pushed before it merged, plus the numba typing change they led to.Changes
Use the stored PN reduced spin in TaylorF2.
TaylorF2_aligned_inplacere-derivedchi_pn = chis*(1 - 76/113*eta) + delta*chiainline, whileBinaryIntrinsicParamsManageralready computes the same value aschi_postnewtonian. The removed IMRPhenomD module was that field's only reader, so it had become dead in production. TaylorF2 now readsparams_intrinsic.chi_postnewtonian. Aligned-spin waveform output (F,TF,TFp,PF,AFwithamplitude_pn_mode=2and nonzero spins) is bit-identical before and after.Make the spin checks in
test_binary_loadround-trip. The localchi_postnewtonian_referencehelper added in #51 only built the packed input; every spin assertion compared manager fields to each other. The test now also checks thatchi_postnewtonian_norm,chi_postnewtonian,chi_a,chi_s,chi_1z,chi_2zandchi_effrecovered by the manager match the test inputs. The tolerance on the spins scales like the existingmass_deltatolerance for nearly equal masses. Flipping the sign of thedelta*chiaterm in the helper now fails the test; before, it passed.Type-check numba in the pyrefly hook. numba ships
py.typedsince 0.66, so the hook now installsnumba>=0.66and numba is removed from[tool.pyrefly].ignore-missing-imports. The rationale comments inpyproject.tomland.pre-commit-config.yaml, which #51 had reworded to say numba ships nopy.typed, are corrected.Use pyrefly-specific ignores on
prangeloops. With real numba types, pyrefly reportsfor ... in prange(...)as not iterable. Pyright does not: it infersprange(...)asrangefrom numba's__new__. The eight existing# type: ignore[not-iterable]comments were therefore only needed by pyrefly, and pyright reports them as unnecessary whenreportUnnecessaryTypeIgnoreCommentis on. They are now# pyrefly: ignore[not-iterable], which pyright does not inspect.Dependency audit
Every third-party import in the tracked Python files was checked against what the pyrefly hook and the pyright CI job install. Nothing else is missing.
py.typedpy.typed(new)types-PyYAMLdevextradevextrapy.typedVerification
tests/test_binary_load.py: 13689 passedtests/test_algebra_tools.py: 24646 passedprangeloops, all covered by the ignores above.Known
tests/test_wavemaket.py:150error (np.gradientreturn type under numpy 2.5.3 stubs). It is unrelated and unchanged here.prangeloops asattr-defined. The CI mypy job does not install numba, so this does not affect CI. The oldtype: ignore[not-iterable]comments did not cover it either.🤖 Generated with Claude Code