Fix vectorized boolean signature - #980
Conversation
|
@EltonChang1 thanks for your PR! Please fix the name of the change log ;) |
Signed-off-by: Elton Chang <tchang52@ucsc.edu>
|
Fixed in 74b8ee5: the Towncrier fragment is now |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #980 +/- ##
===========================================
- Coverage 96.23% 80.39% -15.85%
===========================================
Files 48 48
Lines 10099 10099
===========================================
- Hits 9719 8119 -1600
- Misses 380 1980 +1600 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Elton Chang <tchang52@ucsc.edu>
Signed-off-by: Elton Chang <tchang52@ucsc.edu>
|
Addressed the patch-coverage failure in 4f0a672 by separating the no-Numba |
Relevant Issue(s)/PR(s)
Fixes #979.
Provide an overview of the implemented solution or the fix and elaborate on the modifications.
Newer Numba versions evaluate signature strings against
numba.types, wherebool(...)resolves to Python's built-inbooland raisesTypeError: bool expected at most 1 argument, got 6during Stingray import.This changes the
check_powers_for_intrinsic_coherencevectorized signatures to use Numba type objects with an explicitbooleanreturn type instead of parsingbool(...)strings. It also exposesbooleanthrough Stingray's Numba compatibility wrapper, adds scalar regression coverage for the affected function, and includes a bugfix changelog fragment.Is there a new dependency introduced by your contribution? If so, please specify.
No new dependencies.
Any other comments?
Validation performed:
.venv/bin/python -m pytest stingray/tests/test_fourier.py -qwith NumPy 2.4.6, Astropy 8.0.0, Numba 0.65.1: 199 passed..venv/bin/python -m pytest stingray/tests/test_fourier.py -k check_powers_for_intrinsic_coherence -qwith NumPy 1.24.4, Astropy 6.1.3, Matplotlib 3.10.9, Numba 0.65.1: 1 passed, 198 deselected.import stingraysucceeds andcheck_powers_for_intrinsic_coherence(...)returns normally.git diff --check.Limitations: I did not run the full repository test suite.
AI disclosure: OpenAI Codex/ChatGPT was used to inspect the issue, identify the affected signature, make the code/test/changelog edits, and draft this PR description. The final patch was validated locally with the checks listed above.