Skip to content

Commit

Permalink
Add atkeyword macro to basedocs.jl, move some docs inline.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHatherly committed Dec 16, 2015
1 parent be35ce8 commit 6f694f6
Show file tree
Hide file tree
Showing 7 changed files with 812 additions and 683 deletions.
26 changes: 26 additions & 0 deletions base/dft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,32 @@ end

# FFTW module (may move to an external package at some point):
if Base.USE_GPL_LIBS

@doc """
fft(A [, dims])
Performs a multidimensional FFT of the array `A`. The optional `dims` argument specifies an
iterable subset of dimensions (e.g. an integer, range, tuple, or array) to transform along.
Most efficient if the size of `A` along the transformed dimensions is a product of small
primes; see `nextprod()`. See also `plan_fft()` for even greater efficiency.
A one-dimensional FFT computes the one-dimensional discrete Fourier transform (DFT) as
defined by
```math
\\operatorname{DFT}(A)[k] =
\\sum_{n=1}^{\\operatorname{length}(A)}
\\exp\\left(-i\\frac{2\\pi
(n-1)(k-1)}{\\operatorname{length}(A)} \\right) A[n].
```
A multidimensional FFT simply performs this operation along each transformed dimension of `A`.
Higher performance is usually possible with multi-threading. Use `FFTW.set_num_threads(np)`
to use `np` threads, if you have `np` processors.
""" ->
fft

include("fft/FFTW.jl")
importall .FFTW
export FFTW, dct, idct, dct!, idct!, plan_dct, plan_idct, plan_dct!, plan_idct!
Expand Down
Loading

3 comments on commit 6f694f6

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to do doctests in the keyword docs? Do those go anywhere in the rst right now?

@MichaelHatherly
Copy link
Member Author

Choose a reason for hiding this comment

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

Is it possible to do doctests in the keyword docs?

Should be possible, just needs the examples to be changed to jldoctest and a test in the testsuite that evals all the doctest blocks in keywords. Might be worth generalising it to test all docstrings from the Julia-side rather than from sphinx though, since we're going to move everything over to markdown eventually. Maybe we need a doctest(::Module) function built into Base.

Do those go anywhere in the rst right now?

Not as far as I can see.

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks.

Maybe we need a doctest(::Module) function built into Base.

Need a pure Julia implementation of this somewhere, doesn't necessarily have to be in base. It's not a big deal for doctest-running or html-building to require Docile or whatever other package IMO.

Please sign in to comment.