You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multiband periodic_fit documents nterms, but takes nterms_base and nterms_band #20207
Following up on #20205, where @pllim asked me to open one issue per remaining problem. Different subpackage from #20206.
periodic_fit in the multiband Lomb-Scargle MLE implementation documents nterms:
defperiodic_fit(
t, y, dy, bands, frequency, t_fit, bands_fit,
center_data=True,
nterms_base=1,
nterms_band=1,
...
):
"""...
nterms : int (default=1)
ThenumberofFouriertermstoincludeinthefit
There is no nterms parameter. The function takes two separate term counts, nterms_base and nterms_band, and neither is documented — so a reader following the docstring would pass nterms=... and get a TypeError, while the two knobs that do exist are invisible.
Looks like the docstring was carried over from the single-band periodic_fit, which does take a single nterms.
The fix would be to replace the entry with the two real parameters, but the wording for each depends on what the multiband model does with them (base terms shared across bands vs. per-band terms), so I would rather not guess at the description. Happy to send a PR if you tell me how you would phrase the two.
Found with a static checker comparing numpydoc parameter names against the signature below them; each finding was read by hand.
Beyond just nterms, it looks like there are several kwargs not represented in the docstring (reg_base, reg_band, regularize_by_trace, bands_fit). You should again be able to use the main docstring above to populate these, with the exception of bands_fit, which I would suggest just using the definition for that found in various places within the sub-module:
bands_fit : array-like, or str
Bands to use in fitting, must be subset of bands in input data.
Thanks — that's much more useful than just the one tag. Sent #20212 with all seven: nterms_base, nterms_band, reg_base, reg_band, regularize_by_trace and bands_fit added, nterms dropped, entries ordered to match the signature.
Descriptions are taken verbatim from LombScargleMultiband as you suggested, and bands_fit uses the phrasing from the submodule.
Activity
pllim commentedon Aug 5, 2026
Looks like this has been an issue since it was originally written in #14016 . Perhaps @dougbrn or @astrofrog could clarify. Thanks!
dougbrn commentedon Aug 5, 2026
It certainly looks like the
periodic_fitdocstring was not fully updated for it's multiband version, and that would certainly have happened in the original PR, apologies that slipped through. These kwargs have descriptions in the docstring of the main class, so I would expect they can be used directly inperiodic_fitas well: https://github.com/astropy/astropy/blob/main/astropy/timeseries/periodograms/lombscargle_multiband/core.py#L33Beyond just nterms, it looks like there are several kwargs not represented in the docstring (reg_base, reg_band, regularize_by_trace, bands_fit). You should again be able to use the main docstring above to populate these, with the exception of bands_fit, which I would suggest just using the definition for that found in various places within the sub-module:
darkdi commentedon Aug 5, 2026
Thanks — that's much more useful than just the one tag. Sent #20212 with all seven:
nterms_base,nterms_band,reg_base,reg_band,regularize_by_traceandbands_fitadded,ntermsdropped, entries ordered to match the signature.Descriptions are taken verbatim from
LombScargleMultibandas you suggested, andbands_fituses the phrasing from the submodule.