Fix AveragedCrossspectrum for input_counts=False light curves#978
Open
VrtxOmega wants to merge 2 commits into
Open
Fix AveragedCrossspectrum for input_counts=False light curves#978VrtxOmega wants to merge 2 commits into
VrtxOmega wants to merge 2 commits into
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 #977.
Provide an overview of the implemented solution or the fix and elaborate on the modifications.
AveragedCrossspectrumwas passing the private light-curve storage fields(
_countsand_counts_err) into the shared time-series cross-spectrum helper.For light curves created with
input_counts=False, the publiccountsandcounts_erraccessors provide the countrate-derived arrays, while the privatecounts fields can remain unsuitable for this path. That made the cross spectrum
return zero powers for countrate light curves even though
AveragedPowerspectrumworked.
This updates the light-curve path to pass public
countsandcounts_err,matching the existing
AveragedPowerspectrumand iterable cross-spectrum paths.It also adds a regression test for identical
input_counts=Falselight curvesand the PR-numbered changelog fragment required by the repository gate.
Is there a new dependency introduced by your contribution? If so, please specify.
No.
Any other comments?
I personally re-checked this before updating the branch:
bugandhelp wanted,unassigned, and the only open overlapping PR is this one.
origin/mainat840569c6,input_counts=FalseGaussian countrate cases with zero and nonzero errorsreturned zero/non-matching cross spectra. Against this branch at
c16b3f1c,both cases became nonzero and matched
AveragedPowerspectrum.input_counts=TrueGaussian zero-error and defaultPoisson counts cases still match
AveragedPowerspectrum.PR_NUMBER=978 ... docs/changes/$PR_NUMBER.*.rst.venv/bin/python -m pytest stingray/tests/test_crossspectrum.py::TestAveragedCrossspectrum::test_input_countrate_matches_pds_for_identical_lightcurves -q.venv/bin/python -m pytest stingray/tests/test_crossspectrum.py -q(260 passed, 9 skipped)git diff --check origin/main...HEADKnown CI note: local
uvx tox -e linkcheckfails on external documentationlinks already present on
origin/main(join.slack.comreturns 403 andpyopensci.org/badges/peer-reviewed.svgreturns 404 after redirect). Thisbranch does not touch those links.