Skip to content

Conversation

DietBru
Copy link
Contributor

@DietBru DietBru commented Nov 19, 2023

  • Marked function stft(), istft() and spectrogram() as legacy in docstrings. This is a helpful clarification in the function list of the API reference.
  • Beautified the Python code example in signal.rst a little bit
  • A few small fixes in signal.rst and _short_time_fft.py

[skip actions] [skip cirrus]

@DietBru DietBru force-pushed the ShortTimeFFT_Doc_fixes branch from 41581e4 to 23681ee Compare November 19, 2023 11:25
@lucascolley lucascolley added maintenance Items related to regular maintenance tasks scipy.fft scipy.signal Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org and removed scipy.fft labels Nov 19, 2023
Copy link
Member

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

thanks @DietBru, the diff LGTM - can you merge main so that we can check the docs build? The artefact has expired.

* Marked function stft(), istft() and spectrogram as legacy in docstring.
* In Python code example in `signal.rst`:
   - Removed most doctest workarounds, i.e., expressions like ``_ = ...``.
   - Beautified code and y-label a little bit
* Use '~' to shorten displayed link, e.g. :func:`~scipy.fft.fft()` in ShortTimeFFT.fft_mode() docstring
* Fixed `ShortTimeFFT.scaling` fixed link to scale_to() method
* Remove typo in ShortTimeFFT.extent()
@DietBru DietBru force-pushed the ShortTimeFFT_Doc_fixes branch from 23681ee to 6aae8e9 Compare December 29, 2023 10:24
@j-bowhay j-bowhay added this to the 1.13.0 milestone Dec 29, 2023
@DietBru
Copy link
Contributor Author

DietBru commented Dec 29, 2023

Thanks for reviewing, @lucascolley. I just rebased onto the current main. The rendered changes can be found at :

Copy link
Member

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

LGTM, thanks again!

>>> fig1.colorbar(im1b, ax=axx, label="Magnitude $|S_z(t, f)|$")
>>> _ = fig1.supylabel(rf"Frequency $f$ in Hertz ($\Delta f = %g\,$Hz)" %
... SFT.delta_f)
>>> _ = fig1.supylabel(r"Frequency $f$ in Hertz ($\Delta f = %g\,$Hz)" %
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this?

Suggested change
>>> _ = fig1.supylabel(r"Frequency $f$ in Hertz ($\Delta f = %g\,$Hz)" %
>>> fig1.supylabel(r"Frequency $f$ in Hertz ($\Delta f = %g\,$Hz)" %

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed because otherwise python dev.py -n refguide-check would produce the following error:

File "doc/source/tutorial/signal.rst", line 1490, in /home/dietrich/GitHub/scipy/tools/../doc/source/tutorial/signal.rst
Failed example:
    fig1.supylabel(r"Frequency $f$ in Hertz ($\Delta f = %g\,$Hz)" %
                       SFT.delta_f, x=0.08, y=0.5, fontsize='medium')
Expected nothing
Got:
    Text(0.08, 0.5, 'Frequency $f$ in Hertz ($\\Delta f = 4\\,$Hz)')


ERROR: refguide or doctests have errors

@larsoner
Copy link
Member

larsoner commented Jan 2, 2024

Approved by @lucascolley, the one remaining comment from @j-bowhay seems to be addressed, and LGTM so in it goes, thanks @DietBru !

@larsoner larsoner merged commit 16e58d0 into scipy:main Jan 2, 2024
@DietBru DietBru deleted the ShortTimeFFT_Doc_fixes branch January 2, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org maintenance Items related to regular maintenance tasks scipy.signal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants