Skip to content

DEP: signal.lombscargle: deprecate argument precenter - #23476

Merged
tylerjereddy merged 11 commits into
scipy:mainfrom
adammj:lombscargle_DEP
Nov 24, 2025
Merged

tylerjereddy merged 11 commits into
scipy:mainfrom
adammj:lombscargle_DEP

Conversation

@adammj

@adammj adammj commented Aug 17, 2025 •

Copy link
Copy Markdown
Contributor

First stab at deprecating precenter argument, which was made useless after #21277 was merged last year.

Reference issue

None.

What does this implement/fix?

Flags precenter for deprecation, as it is legacy and no longer necessary—and less useful than the floating_mean argument (as already detailed in the Notes).

Additional information

Would need to be committed after gh-23475.

@adammj
adammj requested review from ilayn and larsoner as code owners August 17, 2025 17:46
@github-actions github-actions Bot added scipy.signal deprecated Items related to behavior that has been deprecated labels Aug 17, 2025
@tylerjereddy tylerjereddy added this to the 1.17.0 milestone Aug 17, 2025
Comment thread scipy/signal/_spectral_py.py Resolved
@tylerjereddy

Copy link
Copy Markdown
Contributor

I've added the 1.17.0 milestone so this doesn't fall off our radar, but we do have a bit more time to decide on this one vs. your preceding bug fix PR.

@adammj

adammj commented Aug 17, 2025 •

Copy link
Copy Markdown
Contributor Author

@neutrinoceros, since the changes to lombscargle last year started some discussion with astropy, it made sense to check if this deprecation would cause any issues. However, looking over the astropy repo, I don't see any uses of the precenter argument.

correction: there is one uncommitted astropy PR that mentions it. astropy/astropy#17170

@adammj

adammj commented Aug 19, 2025

Copy link
Copy Markdown
Contributor Author

I'm a little confused as to the purpose of the functions in signal/_delegators.py, and if anything needs to be updated there.

@rgommers

Copy link
Copy Markdown
Member

I'm a little confused as to the purpose of the functions in signal/_delegators.py, and if anything needs to be updated there.

They are for supporting other array types. E.g., if you pass in a CuPy array (and have SCIPY_ARRAY_API=1 set), then the code in _delegators.py will ensure that cupyx.scipy.signal.lombscargle is called.

The CI failure is unrelated. I don't think you need to do anything to handle this deprecation in _delegators.py.

@DietBru DietBru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just some suggestions for the docstr. Otherwise, it looks good to me.

Comment thread scipy/signal/_spectral_py.py Resolved
Comment thread scipy/signal/_spectral_py.py Resolved
Comment thread scipy/signal/_spectral_py.py Resolved

@DietBru DietBru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now. Thanks, @adammj@adammj.

@lucascolley

Copy link
Copy Markdown
Member

Have we posted on the forum about this deprecation?

@lucascolley lucascolley added the needs-release-note A maintainer should add a release note written by a reviewer/author to the wiki. label Nov 21, 2025
@lucascolley

Copy link
Copy Markdown
Member

Have we posted on the forum about this deprecation?

it seems not. Just to put this (back) on your radars as the deadline for 1.17.0 is approaching @adammj @DietBru , would be good to have a simple post like https://discuss.scientific-python.org/t/dep-stats-ttest-ind-deprecate-random-state-permutation-require-keywords-for-most-args/1552, then we can merge this if no complaints.

@adammj

adammj commented Nov 21, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the reminder, @lucascolley. It's been posted: https://discuss.scientific-python.org/t/dep-signal-lombscargle-deprecate-argument-precenter/2178

@tylerjereddy tylerjereddy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's give this a try. The CI is all green, and astropy folks didn't really object in the cross-linked PR (they mentioned working around the deprecation). The diff seems sensible to me, and the rendered docs for lombscargle seem decent to me with the changes here.

It is true that the forum post has no responses, but that's not unusual for a deprecation query. We could wait a few more days, but this has the appropriate approvals and has been open for a few months now too, so I think I'd prefer to get it in and reduce our list of milestoned PRs by one more. If someone really objects to the deprecation we may also be able to catch that in the RC phase and revert, but seems unlikey.

Thanks all, I'll probably squash merge, commit history a bit messy here.

@tylerjereddy
tylerjereddy merged commit 3bec13b into scipy:main Nov 24, 2025
5 checks passed
@adammj
adammj deleted the lombscargle_DEP branch November 24, 2025 05:54
@tylerjereddy tylerjereddy removed the needs-release-note A maintainer should add a release note written by a reviewer/author to the wiki. label Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecated Items related to behavior that has been deprecated scipy.signal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants