Skip to content

DOC: fft.{fht, ifht}: add new examples#24884

Open
Elle-Musoke wants to merge 8 commits into
scipy:mainfrom
Elle-Musoke:hankel-examples
Open

DOC: fft.{fht, ifht}: add new examples#24884
Elle-Musoke wants to merge 8 commits into
scipy:mainfrom
Elle-Musoke:hankel-examples

Conversation

@Elle-Musoke
Copy link
Copy Markdown
Contributor

Add new examples to fht and ifht docstrings. Create example subsections on fht because it now has two examples.

[docs only]

Reference issue

#7168

What does this implement/fix?

This change adds an example to the ifht docstring and a second, simpler example to the fht docstring.

Additional information

Tech notes: Hankel transforms are new to me, so please keep an eagle eye out for incorrect logic.

Doc notes:
Please correct me if the following aren't the way things are done in the SciPy doc.

  • I added the new simple fht example above the longer, more conceptual example. This way new users will encounter it first and experienced users will know enough to scroll past it.
  • I also couldn't find a reference for how to separate multiple examples in the same docstring, so I used bold titles for each.

AI Generation Disclosure

No AI tools used

@github-actions github-actions Bot added scipy.fft Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org labels Mar 21, 2026
Add new examples to fht and ifht docstrings. Create example subsections on fht because it now has two examples.

[docs only]
@Elle-Musoke
Copy link
Copy Markdown
Contributor Author

Elle-Musoke commented Mar 21, 2026

@mdhaber You gave me some really helpful tips on my first docstring example pull request. Would you mind having a look over my doc-related questions in the Additional Information section of this one?

@lucascolley lucascolley changed the title DOC: Hankel examples DOC: fft.{fht, ifht}: add new examples Mar 21, 2026
@lucascolley lucascolley added this to the 1.18.0 milestone Mar 21, 2026
@lucascolley lucascolley removed the request for review from peterbell10 March 21, 2026 21:56
Comment thread scipy/fft/_fftlog.py Outdated
Comment thread scipy/fft/_fftlog.py Outdated
@Elle-Musoke
Copy link
Copy Markdown
Contributor Author

Elle-Musoke commented Mar 22, 2026

@lucascolley I incorporated your suggestions with the exception of the spaces around the / operator (I'm following the guidance in scientific-python/specs#326). Thanks!

Elle-Musoke and others added 2 commits April 2, 2026 20:49
[docs only]

Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
[docs only]
@Elle-Musoke
Copy link
Copy Markdown
Contributor Author

@lucascolley I missed one of your suggestions the other week, but it's in now. What do you think?

Comment thread scipy/fft/_fftlog.py
Comment on lines +283 to +287
Calculate the evaluation points for the transformed data ``a``.
Since ``ifht`` returns the transformed data in ascending order of
evaluation points, flip ``k`` in the evaluation points equation.

>>> r = 1/np.flip(k)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @ntessore, could we possibly trouble you to check that this is correct?

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.

Apologies for the delay. The function evaluates the FHT on a logarithmic grid of values $k$ such that $kr$ = const. and returns function values $F(k)$ in ascending order of $k$. So the statement is correct but it took me a second to understand that it is correct. Maybe there is an easier way to say what's going on here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apologies for the delay. The function evaluates the FHT on a logarithmic grid of values k such that k r = const. and returns function values F ( k ) in ascending order of k . So the statement is correct but it took me a second to understand that it is correct. Maybe there is an easier way to say what's going on here?

@Elle-Musoke can you think of an easier way? Either way, let's get this in for 1.18.0.

Comment thread scipy/fft/_fftlog.py Outdated
Comment thread scipy/fft/_fftlog.py Outdated
Comment thread scipy/fft/_fftlog.py Outdated
Comment thread scipy/fft/_fftlog.py Outdated
Elle-Musoke and others added 4 commits May 1, 2026 16:01
[docs only]

Co-authored-by: Florian Bourgey <bourgeyflorian@gmail.com>
[docs only]

Co-authored-by: Florian Bourgey <bourgeyflorian@gmail.com>
[docs only]

Co-authored-by: Florian Bourgey <bourgeyflorian@gmail.com>
[docs only]

Co-authored-by: Florian Bourgey <bourgeyflorian@gmail.com>
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 scipy.fft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants