Skip to content

Commit a1c01da

Browse files
authored
Merge branch 'master' into speedup_python_ci
2 parents 7434189 + 046fbba commit a1c01da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+976
-967
lines changed

.github/workflows/python_test_win.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ python -m pip install finufft -f .\wheelhouse\
22
if (-not $?) {throw "Failed to pip install finufft"}
33
python python/test/run_accuracy_tests.py
44
if (-not $?) {throw "Tests failed"}
5+
python python/examples/simple1d1.py
6+
if (-not $?) {throw "Simple1d1 test failed"}

.github/workflows/python_wheel.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ jobs:
108108
run: |
109109
make lib
110110
export FINUFFT_DIR=`pwd`
111+
export CC=gcc-11
112+
export CXX=g++-11
111113
cd python
112114
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip install --upgrade setuptools wheel numpy pip
113115
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip install -U wheel --user
@@ -129,14 +131,19 @@ jobs:
129131
ls wheelhouse/finufft*.whl | xargs -n1 $PYTHON_BIN/delocate-wheel -w fixed_wheel/
130132
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip install finufft -f fixed_wheel/
131133
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 test/run_accuracy_tests.py
134+
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 examples/simple1d1.py
132135
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pip install finufft -f fixed_wheel/
133136
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 test/run_accuracy_tests.py
137+
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 examples/simple1d1.py
134138
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pip install finufft -f fixed_wheel/
135139
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 test/run_accuracy_tests.py
140+
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 examples/simple1d1.py
136141
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install finufft -f fixed_wheel/
137142
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 test/run_accuracy_tests.py
143+
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 examples/simple1d1.py
138144
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install finufft -f fixed_wheel/
139145
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 test/run_accuracy_tests.py
146+
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 examples/simple1d1.py
140147
141148
- name: Upload wheels
142149
uses: actions/upload-artifact@v2

.readthedocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# Required (for this file format)
88
version: 2
99

10+
# Build all formats
11+
formats: all
12+
1013
# Build documentation in the docs/ directory with Sphinx
1114
sphinx:
1215
configuration: docs/conf.py

CHANGELOG

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
11
List of features / changes made / release notes, in reverse chronological order
22

3-
* library private namespacing via finufft::* of all symbols that do not already
4-
begin with finufft{f}. This addresses clash with linking against cufinufft
5-
(their Issue #138).
3+
V 2.1.0 (6/10/22)
4+
5+
* BREAKING INTERFACE CHANGE: nufft_opts is now called finufft_opts.
6+
This is needed for consistency and fixes a historical problem.
7+
We have compile-time warning, and backwards-compatibility for now.
8+
* Professionalized the public-facing interface:
9+
- safe lib (.so, .a) symbols via hierarchical namespacing of private funcs
10+
that do not already begin with finufft{f}, in finufft:: namespace.
11+
This fixes, eg, clash with linking against cufinufft (their Issue #138).
12+
- public headers (finufft.h) has all macro names safe (ie FINUFFT suffix).
13+
Headers both public and private rationalized/simplified.
14+
- private headers are in include/finufft/, so not exposed by -Iinclude
15+
- spread_opts renamed finufft_spread_opts, since publicly exposed and name
16+
must respect library naming.
17+
* change nj and nk in plan to BIGINT (int64_t), new big2d2f perftest, fixing
18+
Issue #215.
19+
* PDF manual moved from local to readthedocs.io hosting, Issue #221.
20+
* Py doc for dtype fixed, Issue #216.
621
* spreadinterp evaluate_kernel_vector uses single arith when FLT=single.
722
* spread_opts.h fix duplication for FLT=single/double by making FLT->double.
823
* examples/simulplans1d1 demos ability to to wield independent plans.
924
* sped up float32 1d type 3 by 20% by using float32 cos()... thanks Wenda Zhou.
1025

1126
V 2.0.4 (1/13/22)
12-
27+
1328
* makefile now appends (not replaces by) environment {C,F,CXX}FLAGS (PR #199).
1429
* fixed MATLAB Contents.m and guru help strings.
1530
* fortran examples: avoided clash with keywords "type" and "null", and correct
1631
creation of null ptr for default opts (issues #195-196, Jiri Kulda).
1732
* various fixes to python wheels CI.
18-
* various docs improvements.
33+
* various docs improvements.
1934
* fixed modeord=1 failure for type 3 even though should never be used anyway
2035
(issue #194).
2136
* fixed spreadcheck NaN failure to detect bug introduced in 2.0.3 (9566511).

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ see `docs/ackn.rst` for full list of contributors.
1313

1414
This is a lightweight library to compute the three standard types of nonuniform FFT to a specified precision, in one, two, or three dimensions. It is written in C++ with interfaces to C, Fortran, MATLAB/octave, Python, and (in a separate [repository](https://github.com/ludvigak/FINUFFT.jl)) Julia.
1515

16-
Please see the [online documentation](http://finufft.readthedocs.io/en/latest/index.html), or its local PDF equivalent, the [user manual](finufft-manual.pdf).
16+
Please see the [online documentation](http://finufft.readthedocs.io/en/latest/index.html) which can also be downloaded as a [PDF manual](https://finufft.readthedocs.io/_/downloads/en/latest/pdf/).
1717
You will also want to see example codes in the directories
1818
`examples`, `test`, `fortran`, `matlab/test`, and `python/test`.
19-
If you cannot compile, or `pip install`, try our [precompiled binaries](http://users.flatironinstitute.org/~ahb/codes/finufft-binaries).
19+
If you cannot compile, or `pip install`, try our rather outdated [precompiled binaries](http://users.flatironinstitute.org/~ahb/codes/finufft-binaries).
2020

2121
If you prefer to read text files, the source to generate the above documentation is in human-readable (mostly .rst) files as follows:
2222

docs/README

Lines changed: 60 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,73 @@
11
README for developers on FINUFFT documentation.
22

3-
The .rst files in this directory are designed for sphinx to auto-generate
4-
documentation in HTML (including from the readthedocs.io website), and in PDF.
3+
The .rst files (and files they include such as .doc)
4+
in this directory are designed for sphinx to auto-generate
5+
documentation, specifically that hosted at the readthedocs.io website
6+
(HTML and PDF versions).
57

6-
The main procedure to regenerate the documentation from source is
7-
``make docs`` from the top-level directory. See ``../makefile`` for
8-
what's going on here. This does some custom bash scripts for the various
9-
language interface docs, then uses sphinx to make latex and html
10-
versions of the entire manual. The readthedocs.io website is triggered
11-
to update when github master branch changes. The idea is:
8+
finufft.readthedocs.io should have been set up to be triggered by
9+
pushes to the git repo master branch to generate HTML/PDF
10+
documentation, hosted there for the world to see. Which formats are
11+
built at that website is controlled by .readthedocs.yml
1212

13-
*.docsrc ---(bash)---> *.doc ----(included in)----> *.rst -----(sphinx)-->
13+
However we autogenerate several parts of this sphinx source, and this
14+
is done by ``make docs``, called from the top-level directory. See
15+
``../makefile`` for what's going on here. It calls some custom bash
16+
scripts to generate various language interface docs (.rst and files
17+
that they include). The results are tracked by git, so don't forget to
18+
commit them and push to master.
1419

15-
/ PDF (sits in the repo)
16-
\ HTML ---(readthedocs trigger)---> finufft.readthedocs.io
20+
Our docs dependency graph is, in broad strokes:
1721

18-
Do not edit files ``docs/*.doc`` since these are machine-generated; your changes will be overwritten. Instead edit files ``*.docsrc`` once you have understood how the bash scripts act on them.
22+
{*.docsrc, ../matlab/*.docsrc, etc} ----(bash, via ``make docs'')---->
23+
{*.doc, *.m} ----(which are included in)----> *.rst
1924

20-
There are also separate MATLAB/Octave (bash) and Python (autodoc) doc
21-
generations going on.
25+
Then {*.rst, *.doc, *.m, *.py, CHANGELOG, certain source codes, etc}
26+
----(triggered by push to github master)---->
27+
finufft.readthedocs.io (generates then hosts HTML/PDF)
2228

23-
To perform doc-generation, you need to set up the following environment
24-
(we have only ever done this on linux):
29+
As of v2.1.0, the local PDF manual is no longer tracked by
30+
git, due to its dominant and growing contribution to the size of the repo.
2531

26-
python3
27-
sphinx - (at least v1.3), can conda install. Needs latex and latexmk
28-
(for ubuntu 20.04: sudo apt install texlive-base latexmk)
29-
texext - a small sphinx helper for math, seems only to be pip-installable:
30-
https://github.com/matthew-brett/texext
32+
Note that ../README.md also should be considered part of the docs, since
33+
it contains a precis for text-loving and github-facing humans.
3134

32-
Then to check the local build of the HTML docs, useful for debugging before you
33-
wait for a git push origin to be detected by RTD, point your browser to the
34-
local file _build/html/index.html
3535

36-
finufft.readthedocs.io should have been set up to be triggered by
37-
pushes to the git repo to regenerate HTML documentation identical to the
38-
local copy, hosted there for the world to see.
36+
1) Details for running ``make docs''
37+
38+
Do not edit files ``docs/*.doc`` since these are machine-generated;
39+
your changes will be overwritten! Instead edit files ``*.docsrc``,
40+
once you have understood how the bash scripts act on them. The same
41+
applies to the separate MATLAB/Octave doc gen (which is in bash). The
42+
python doc gen is *not* done by make docs, instead it is done by
43+
sphinx through its autodoc extension. To run ``make docs'' locally,
44+
you only need bash.
45+
46+
Note that ``make docs`` no longer builds a local copy of the docs in
47+
either HTML or PDF; to do this keep reading.
48+
49+
50+
2) How to do a local sphinx doc build for devs to check them quickly
51+
52+
The github trigger plus readthedocs.io build can take several minutes,
53+
annoying for debugging. For faster doc build checking you'll want to work
54+
locally (we have only ever tried this on linux). For this you'll need
55+
to install:
56+
57+
* sphinx - (at least v1.3), can conda install. Needs latex and latexmk
58+
(for ubuntu 20.04: sudo apt install texlive-base latexmk)
59+
* texext - a small sphinx helper for math, seems only to be pip-installable:
60+
https://github.com/matthew-brett/texext
61+
* python3 - since sphinx autodoc actually runs py to gen docstrings.
62+
63+
Then (from this docs directory), run ``make latexpdf``
64+
and look in _build/latex/finufft.pdf for the PDF.
65+
66+
Or, run ``make html`` then point your browser to
67+
the local file _build/html/index.html
68+
69+
Note that there are some sphinx tags indicated by @ in the source codes;
70+
do not remove them.
3971

40-
Note that ../README.md also should be considered part of the docs, since
41-
it contains a precis for text-loving and github-facing humans.
4272

73+
Alex Barnett, 2022/6/13.

docs/c.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ due to unnecessary array copying.
3232

3333

3434
In all of the simple, vectorized, and plan functions below you may either pass ``NULL`` as the last options
35-
argument to use default options, or a pointer to a valid ``nufft_opts`` struct.
35+
argument to use default options, or a pointer to a valid ``finufft_opts`` struct.
3636
In this latter case you will first need to create an options struct
3737
then set default values by passing a pointer (here ``opts``) to the following::
3838

39-
void finufft_default_opts(nufft_opts* opts)
40-
void finufftf_default_opts(nufft_opts* opts)
39+
void finufft_default_opts(finufft_opts* opts)
40+
void finufftf_default_opts(finufft_opts* opts)
4141
4242
Set values in a NUFFT options struct to their default values.
4343

docs/c1d.doc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
::
22

33
int finufft1d1(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64_t
4-
N1, complex<double>* f, nufft_opts* opts)
4+
N1, complex<double>* f, finufft_opts* opts)
55
int finufftf1d1(int64_t M, float* x, complex<float>* c, int iflag, float eps, int64_t N1,
6-
complex<float>* f, nufft_opts* opts)
6+
complex<float>* f, finufftf_opts* opts)
77

88
int finufft1d1many(int ntr, int64_t M, double* x, complex<double>* c, int iflag, double
9-
eps, int64_t N1, complex<double>* f, nufft_opts* opts)
9+
eps, int64_t N1, complex<double>* f, finufft_opts* opts)
1010
int finufftf1d1many(int ntr, int64_t M, float* x, complex<float>* c, int iflag, float
11-
eps, int64_t N1, complex<float>* f, nufft_opts* opts)
11+
eps, int64_t N1, complex<float>* f, finufftf_opts* opts)
1212

1313
1D complex nonuniform FFT of type 1 (nonuniform to uniform).
1414

@@ -43,14 +43,14 @@
4343
::
4444

4545
int finufft1d2(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64_t
46-
N1, complex<double>* f, nufft_opts* opts)
46+
N1, complex<double>* f, finufft_opts* opts)
4747
int finufftf1d2(int64_t M, float* x, complex<float>* c, int iflag, float eps, int64_t N1,
48-
complex<float>* f, nufft_opts* opts)
48+
complex<float>* f, finufftf_opts* opts)
4949

5050
int finufft1d2many(int ntr, int64_t M, double* x, complex<double>* c, int iflag, double
51-
eps, int64_t N1, complex<double>* f, nufft_opts* opts)
51+
eps, int64_t N1, complex<double>* f, finufft_opts* opts)
5252
int finufftf1d2many(int ntr, int64_t M, float* x, complex<float>* c, int iflag, float
53-
eps, int64_t N1, complex<float>* f, nufft_opts* opts)
53+
eps, int64_t N1, complex<float>* f, finufftf_opts* opts)
5454

5555
1D complex nonuniform FFT of type 2 (uniform to nonuniform).
5656

@@ -85,14 +85,14 @@
8585
::
8686

8787
int finufft1d3(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64_t
88-
N, double* s, complex<double>* f, nufft_opts* opts)
88+
N, double* s, complex<double>* f, finufft_opts* opts)
8989
int finufftf1d3(int64_t M, float* x, complex<float>* c, int iflag, float eps, int64_t N,
90-
float* s, complex<float>* f, nufft_opts* opts)
90+
float* s, complex<float>* f, finufftf_opts* opts)
9191

9292
int finufft1d3many(int ntr, int64_t M, double* x, complex<double>* c, int iflag, double
93-
eps, int64_t N, double* s, complex<double>* f, nufft_opts* opts)
93+
eps, int64_t N, double* s, complex<double>* f, finufft_opts* opts)
9494
int finufftf1d3many(int ntr, int64_t M, float* x, complex<float>* c, int iflag, float
95-
eps, int64_t N, float* s, complex<float>* f, nufft_opts* opts)
95+
eps, int64_t N, float* s, complex<float>* f, finufftf_opts* opts)
9696

9797
1D complex nonuniform FFT of type 3 (nonuniform to nonuniform).
9898

docs/c1d.docsrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
int @F1d1(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64_t N1, complex<double>* f, nufft_opts* opts)
1+
int @F1d1(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64_t N1, complex<double>* f, finufft_opts* opts)
22

33
1D complex nonuniform FFT of type 1 (nonuniform to uniform).
44
@t
@@ -23,7 +23,7 @@ int @F1d1(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64
2323
@notes12
2424

2525

26-
int @F1d2(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64_t N1, complex<double>* f, nufft_opts* opts)
26+
int @F1d2(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64_t N1, complex<double>* f, finufft_opts* opts)
2727

2828
1D complex nonuniform FFT of type 2 (uniform to nonuniform).
2929
@t
@@ -48,7 +48,7 @@ int @F1d2(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64
4848
@notes12
4949

5050

51-
int @F1d3(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64_t N, double* s, complex<double>* f, nufft_opts* opts)
51+
int @F1d3(int64_t M, double* x, complex<double>* c, int iflag, double eps, int64_t N, double* s, complex<double>* f, finufft_opts* opts)
5252

5353
1D complex nonuniform FFT of type 3 (nonuniform to nonuniform).
5454
@t

docs/c2d.doc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
::
22

33
int finufft2d1(int64_t M, double* x, double* y, complex<double>* c, int iflag, double
4-
eps, int64_t N1, int64_t N2, complex<double>* f, nufft_opts* opts)
4+
eps, int64_t N1, int64_t N2, complex<double>* f, finufft_opts* opts)
55
int finufftf2d1(int64_t M, float* x, float* y, complex<float>* c, int iflag, float eps,
6-
int64_t N1, int64_t N2, complex<float>* f, nufft_opts* opts)
6+
int64_t N1, int64_t N2, complex<float>* f, finufftf_opts* opts)
77

88
int finufft2d1many(int ntr, int64_t M, double* x, double* y, complex<double>* c, int
9-
iflag, double eps, int64_t N1, int64_t N2, complex<double>* f, nufft_opts* opts)
9+
iflag, double eps, int64_t N1, int64_t N2, complex<double>* f, finufft_opts* opts)
1010
int finufftf2d1many(int ntr, int64_t M, float* x, float* y, complex<float>* c, int iflag,
11-
float eps, int64_t N1, int64_t N2, complex<float>* f, nufft_opts* opts)
11+
float eps, int64_t N1, int64_t N2, complex<float>* f, finufftf_opts* opts)
1212

1313
2D complex nonuniform FFT of type 1 (nonuniform to uniform).
1414

@@ -45,14 +45,14 @@
4545
::
4646

4747
int finufft2d2(int64_t M, double* x, double* y, complex<double>* c, int iflag, double
48-
eps, int64_t N1, int64_t N2, complex<double>* f, nufft_opts* opts)
48+
eps, int64_t N1, int64_t N2, complex<double>* f, finufft_opts* opts)
4949
int finufftf2d2(int64_t M, float* x, float* y, complex<float>* c, int iflag, float eps,
50-
int64_t N1, int64_t N2, complex<float>* f, nufft_opts* opts)
50+
int64_t N1, int64_t N2, complex<float>* f, finufftf_opts* opts)
5151

5252
int finufft2d2many(int ntr, int64_t M, double* x, double* y, complex<double>* c, int
53-
iflag, double eps, int64_t N1, int64_t N2, complex<double>* f, nufft_opts* opts)
53+
iflag, double eps, int64_t N1, int64_t N2, complex<double>* f, finufft_opts* opts)
5454
int finufftf2d2many(int ntr, int64_t M, float* x, float* y, complex<float>* c, int iflag,
55-
float eps, int64_t N1, int64_t N2, complex<float>* f, nufft_opts* opts)
55+
float eps, int64_t N1, int64_t N2, complex<float>* f, finufftf_opts* opts)
5656

5757
2D complex nonuniform FFT of type 2 (uniform to nonuniform).
5858

@@ -87,14 +87,15 @@
8787
::
8888

8989
int finufft2d3(int64_t M, double* x, double* y, complex<double>* c, int iflag, double
90-
eps, int64_t N, double* s, double* t, complex<double>* f, nufft_opts* opts)
90+
eps, int64_t N, double* s, double* t, complex<double>* f, finufft_opts* opts)
9191
int finufftf2d3(int64_t M, float* x, float* y, complex<float>* c, int iflag, float eps,
92-
int64_t N, float* s, float* t, complex<float>* f, nufft_opts* opts)
92+
int64_t N, float* s, float* t, complex<float>* f, finufftf_opts* opts)
9393

9494
int finufft2d3many(int ntr, int64_t M, double* x, double* y, complex<double>* c, int
95-
iflag, double eps, int64_t N, double* s, double* t, complex<double>* f, nufft_opts* opts)
95+
iflag, double eps, int64_t N, double* s, double* t, complex<double>* f, finufft_opts*
96+
opts)
9697
int finufftf2d3many(int ntr, int64_t M, float* x, float* y, complex<float>* c, int iflag,
97-
float eps, int64_t N, float* s, float* t, complex<float>* f, nufft_opts* opts)
98+
float eps, int64_t N, float* s, float* t, complex<float>* f, finufftf_opts* opts)
9899

99100
2D complex nonuniform FFT of type 3 (nonuniform to nonuniform).
100101

0 commit comments

Comments
 (0)