[codex] Fix vectorized boolean signature#980
Draft
EltonChang1 wants to merge 1 commit into
Draft
Conversation
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.
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.