From 4099b72fd21c96346e69e5ead583e5fb8673a50c Mon Sep 17 00:00:00 2001 From: paugier Date: Mon, 5 Feb 2024 06:31:57 +0100 Subject: [PATCH] Fix doc --- .gitlab-ci.yml | 2 - .readthedocs.yml | 4 +- Makefile | 7 +- doc/conf.py | 6 - noxfile.py | 7 +- pdm.lock | 24 ++-- pixi.lock | 104 +++++++++--------- plugins/README.md | 13 +-- .../fluidfft_builder/__init__.py | 5 + .../create_fake_mod_for_doc.py | 44 +++++--- pyproject.toml | 12 +- src/fluidfft/fft2d/__init__.py | 13 +-- src/fluidfft/fft2d/meson.build | 5 + src/fluidfft/fft3d/__init__.py | 17 +-- src/fluidfft/fft3d/meson.build | 5 + 15 files changed, 131 insertions(+), 137 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 83ab3a6..eb3ccc0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -105,8 +105,6 @@ pages: needs: - job: "image:build" optional: true - variables: - FLUIDFFT_TRANSONIC_BACKEND: "python" script: - nox -s doc - mkdir -p public/$CI_COMMIT_REF_NAME diff --git a/.readthedocs.yml b/.readthedocs.yml index 5e0a42b..f7b43c6 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -15,8 +15,8 @@ build: post_install: - pdm use -f $READTHEDOCS_VIRTUALENV_PATH - pdm sync -G doc --no-self - - pdm run pip install plugins/fluidfft-pyfftw - - FLUIDFFT_TRANSONIC_BACKEND="python" pip install . -v --no-deps + - pdm run python -c "from fluidfft_builder import create_fake_modules as c; c()" + - pdm run pip install . --no-deps -C setup-args=-Dtransonic-backend=python sphinx: configuration: doc/conf.py \ No newline at end of file diff --git a/Makefile b/Makefile index 64a96ef..1290196 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ -.PHONY: clean cleanall develop build_ext_inplace list-sessions tests +.PHONY: clean cleanall develop list-sessions tests doc develop: sync + pdm run python -c "from fluidfft_builder import create_fake_modules as c; c()" pdm run pip install -e . --no-deps --no-build-isolation -v pdm run pip install -e plugins/fluidfft-fftw --no-build-isolation -v @@ -12,7 +13,6 @@ develop_fftwmpi: sync: pdm sync --clean --no-self - pdm run pip install -e plugins/fluidfft-builder clean: rm -rf build @@ -64,6 +64,9 @@ list-sessions: lock: pdm lock -G :all +doc: + nox -s doc + # Catch-all target: route all unknown targets to nox sessions %: @nox --version 2>/dev/null || pip install nox diff --git a/doc/conf.py b/doc/conf.py index 7672024..5a3207d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -15,7 +15,6 @@ import os from pathlib import Path import subprocess -from runpy import run_path import getpass from subprocess import call @@ -94,11 +93,6 @@ def save_fig_scaling(dir_name, dim, n0, n1, n2=None): except OSError: print("Can not find doxygen to generate the documentation of the cpp code.") -run_path( - "../plugins/fluidfft-builder/fluidfft_builder/src_cy/create_fake_mod_for_doc.py" -) - - # -- General configuration ---------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. diff --git a/noxfile.py b/noxfile.py index 7f2960d..34164ab 100644 --- a/noxfile.py +++ b/noxfile.py @@ -109,12 +109,11 @@ def run_command(command, **kwargs): @nox.session def doc(session): - session.run_always("pdm", "sync", "-G", "doc", "--no-self", external=True) + session.run_always("pdm", "sync", "--clean", "-G", "doc", "--no-self", external=True) + session.run_always("python", "-c", "from fluidfft_builder import create_fake_modules as c; c()") session.install( - ".", "--no-deps", "--config-settings=setup-args=-Dtransonic-backend=python" + ".", "--no-deps", "-C", "setup-args=-Dtransonic-backend=python" ) - session.install("-e", "plugins/fluidfft-pyfftw") - session.chdir("doc") session.run("make", "cleanall", external=True) session.run("make", external=True) diff --git a/pdm.lock b/pdm.lock index dccc91e..6c00013 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "build", "dask", "dev", "doc", "lint", "mpi", "pyfftw", "test"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.1" -content_hash = "sha256:6a061f9f4ec1babd4a79558e7328bc622610dd996a37f27754876441f84f9e20" +content_hash = "sha256:57e808ead91d9ff56f1c42dbbd7712ab06f3763884657d0c1f3fa21b956e7ff0" [[package]] name = "alabaster" @@ -110,7 +110,7 @@ files = [ [[package]] name = "astroid" -version = "3.0.2" +version = "3.0.3" requires_python = ">=3.8.0" summary = "An abstract syntax tree for Python with inference support." groups = ["lint"] @@ -118,8 +118,8 @@ dependencies = [ "typing-extensions>=4.0.0; python_version < \"3.11\"", ] files = [ - {file = "astroid-3.0.2-py3-none-any.whl", hash = "sha256:d6e62862355f60e716164082d6b4b041d38e2a8cf1c7cd953ded5108bac8ff5c"}, - {file = "astroid-3.0.2.tar.gz", hash = "sha256:4a61cf0a59097c7bb52689b0fd63717cd2a8a14dc9f1eee97b82d814881c8c91"}, + {file = "astroid-3.0.3-py3-none-any.whl", hash = "sha256:92fcf218b89f449cdf9f7b39a269f8d5d617b27be68434912e11e79203963a17"}, + {file = "astroid-3.0.3.tar.gz", hash = "sha256:4148645659b08b70d72460ed1921158027a9e53ae8b7234149b1400eddacbb93"}, ] [[package]] @@ -823,6 +823,14 @@ files = [ {file = "fluiddyn-0.5.3.tar.gz", hash = "sha256:75a3f9640716a686a87337c615ecd6b9dc88f8dd797f407863e3a995645f0513"}, ] +[[package]] +name = "fluidfft-builder" +version = "0.0.1" +editable = true +path = "./plugins/fluidfft-builder" +summary = "Fluidfft plugin dependencies" +groups = ["doc", "test"] + [[package]] name = "fonttools" version = "4.47.2" @@ -879,13 +887,13 @@ files = [ [[package]] name = "fsspec" -version = "2023.12.2" +version = "2024.2.0" requires_python = ">=3.8" summary = "File-system specification" groups = ["dask"] files = [ - {file = "fsspec-2023.12.2-py3-none-any.whl", hash = "sha256:d800d87f72189a745fa3d6b033b9dc4a34ad069f60ca60b943a63599f5501960"}, - {file = "fsspec-2023.12.2.tar.gz", hash = "sha256:8548d39e8810b59c38014934f6b31e57f40c1b20f911f4cc2b85389c7e9bf0cb"}, + {file = "fsspec-2024.2.0-py3-none-any.whl", hash = "sha256:817f969556fa5916bc682e02ca2045f96ff7f586d45110fcb76022063ad2c7d8"}, + {file = "fsspec-2024.2.0.tar.gz", hash = "sha256:b6ad1a679f760dda52b1168c859d01b7b80648ea6f7f7c7f5a8a91dc3f3ecb84"}, ] [[package]] @@ -2262,7 +2270,7 @@ name = "pip" version = "24.0" requires_python = ">=3.7" summary = "The PyPA recommended tool for installing Python packages." -groups = ["dev"] +groups = ["test"] files = [ {file = "pip-24.0-py3-none-any.whl", hash = "sha256:ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc"}, {file = "pip-24.0.tar.gz", hash = "sha256:ea9bd1a847e8c5774a5777bb398c19e80bcd4e2aa16a4b301b718fe6f593aba2"}, diff --git a/pixi.lock b/pixi.lock index 2aef49a..2c3efc6 100644 --- a/pixi.lock +++ b/pixi.lock @@ -7238,7 +7238,7 @@ package: timestamp: 1701352639132 - platform: linux-64 name: libxml2 - version: 2.12.4 + version: 2.12.5 category: main manager: conda dependencies: @@ -7247,21 +7247,21 @@ package: - libiconv >=1.17,<2.0a0 - libzlib >=1.2.13,<1.3.0a0 - xz >=5.2.6,<6.0a0 - url: https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.12.4-h232c23b_1.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.12.5-h232c23b_0.conda hash: - md5: 53e951fab78d7e3bab40745f7b3d1620 - sha256: f6828b44da29bbfbf367ddbc72902e84ea5f5de933be494d6aac4a35826afed0 - build: h232c23b_1 + md5: c442ebfda7a475f5e78f1c8e45f1e919 + sha256: db9bf97e9e367985204331b58a059ebd5a4e0cb9e1c8754e9ecb23046b7b7bc1 + build: h232c23b_0 arch: x86_64 subdir: linux-64 - build_number: 1 + build_number: 0 license: MIT license_family: MIT - size: 704907 - timestamp: 1705355040145 + size: 704829 + timestamp: 1707084502281 - platform: osx-64 name: libxml2 - version: 2.12.4 + version: 2.12.5 category: main manager: conda dependencies: @@ -7269,21 +7269,21 @@ package: - libiconv >=1.17,<2.0a0 - libzlib >=1.2.13,<1.3.0a0 - xz >=5.2.6,<6.0a0 - url: https://conda.anaconda.org/conda-forge/osx-64/libxml2-2.12.4-hc0ae0f7_1.conda + url: https://conda.anaconda.org/conda-forge/osx-64/libxml2-2.12.5-hc0ae0f7_0.conda hash: - md5: 6ffac7334d3c1672845bc4b2a9e39835 - sha256: edccf142e32ee5c6619aebf36c29acdb942bde32fc0585882f5848d86b3e5acd - build: hc0ae0f7_1 + md5: abe27e7ab68b95e8d0e41cd5018ec8ae + sha256: a84f355dcf9039ae54e21bf8833c16200f848fd333a5e68c143e142cc55dc07d + build: hc0ae0f7_0 arch: x86_64 subdir: osx-64 - build_number: 1 + build_number: 0 license: MIT license_family: MIT - size: 619880 - timestamp: 1705355303675 + size: 619351 + timestamp: 1707084558935 - platform: win-64 name: libxml2 - version: 2.12.4 + version: 2.12.5 category: main manager: conda dependencies: @@ -7292,18 +7292,18 @@ package: - ucrt >=10.0.20348.0 - vc >=14.2,<15 - vc14_runtime >=14.29.30139 - url: https://conda.anaconda.org/conda-forge/win-64/libxml2-2.12.4-hc3477c8_1.conda + url: https://conda.anaconda.org/conda-forge/win-64/libxml2-2.12.5-hc3477c8_0.conda hash: - md5: bc7291fa70257ccf420b564c870a53b2 - sha256: b3aa51adb9fb9413227cedc0ce7c5d9f9cf99940911cca3da117e940a8b778ce - build: hc3477c8_1 + md5: d8c3c1c8242db352f38cd1dc0bf44f77 + sha256: 15696b049911b3ea5d37672408e500fb27e375d865f8cceac9cb02f9349e6804 + build: hc3477c8_0 arch: x86_64 subdir: win-64 - build_number: 1 + build_number: 0 license: MIT license_family: MIT - size: 1570461 - timestamp: 1705355510142 + size: 1567894 + timestamp: 1707084720091 - platform: linux-64 name: libzlib version: 1.2.13 @@ -13212,19 +13212,19 @@ package: - gast ~=0.5.0 - numpy - python >=3.9 - url: https://conda.anaconda.org/conda-forge/noarch/transonic-0.6.1-pyhd8ed1ab_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/transonic-0.6.1-pyhd8ed1ab_1.conda hash: - md5: 54e7b895193629634511d078e7ad7783 - sha256: 01d7d8e74fcbaaf6c762f97e7f1c846210006f91d0cfc4e0a4eb77c18313f76c - build: pyhd8ed1ab_0 + md5: 0b81f587f958d2a9876359aa2bb24f19 + sha256: bdfac27c09a3d0941d689c1bd58a781276ce53f44aab030f2563aafafadf4904 + build: pyhd8ed1ab_1 arch: x86_64 subdir: linux-64 - build_number: 0 + build_number: 1 license: BSD-3-Clause license_family: OTHER noarch: python - size: 61018 - timestamp: 1706981358526 + size: 60590 + timestamp: 1707111461010 - platform: osx-64 name: transonic version: 0.6.1 @@ -13236,19 +13236,19 @@ package: - gast ~=0.5.0 - numpy - python >=3.9 - url: https://conda.anaconda.org/conda-forge/noarch/transonic-0.6.1-pyhd8ed1ab_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/transonic-0.6.1-pyhd8ed1ab_1.conda hash: - md5: 54e7b895193629634511d078e7ad7783 - sha256: 01d7d8e74fcbaaf6c762f97e7f1c846210006f91d0cfc4e0a4eb77c18313f76c - build: pyhd8ed1ab_0 + md5: 0b81f587f958d2a9876359aa2bb24f19 + sha256: bdfac27c09a3d0941d689c1bd58a781276ce53f44aab030f2563aafafadf4904 + build: pyhd8ed1ab_1 arch: x86_64 subdir: osx-64 - build_number: 0 + build_number: 1 license: BSD-3-Clause license_family: OTHER noarch: python - size: 61018 - timestamp: 1706981358526 + size: 60590 + timestamp: 1707111461010 - platform: win-64 name: transonic version: 0.6.1 @@ -13260,19 +13260,19 @@ package: - gast ~=0.5.0 - numpy - python >=3.9 - url: https://conda.anaconda.org/conda-forge/noarch/transonic-0.6.1-pyhd8ed1ab_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/transonic-0.6.1-pyhd8ed1ab_1.conda hash: - md5: 54e7b895193629634511d078e7ad7783 - sha256: 01d7d8e74fcbaaf6c762f97e7f1c846210006f91d0cfc4e0a4eb77c18313f76c - build: pyhd8ed1ab_0 + md5: 0b81f587f958d2a9876359aa2bb24f19 + sha256: bdfac27c09a3d0941d689c1bd58a781276ce53f44aab030f2563aafafadf4904 + build: pyhd8ed1ab_1 arch: x86_64 subdir: win-64 - build_number: 0 + build_number: 1 license: BSD-3-Clause license_family: OTHER noarch: python - size: 61018 - timestamp: 1706981358526 + size: 60590 + timestamp: 1707111461010 - platform: linux-64 name: typing_extensions version: 4.9.0 @@ -13918,24 +13918,24 @@ package: timestamp: 1684679248466 - platform: linux-64 name: xkeyboard-config - version: '2.40' + version: '2.41' category: main manager: conda dependencies: - libgcc-ng >=12 - - xorg-libx11 >=1.8.6,<2.0a0 - url: https://conda.anaconda.org/conda-forge/linux-64/xkeyboard-config-2.40-hd590300_0.conda + - xorg-libx11 >=1.8.7,<2.0a0 + url: https://conda.anaconda.org/conda-forge/linux-64/xkeyboard-config-2.41-hd590300_0.conda hash: - md5: 07c15d846a2e4d673da22cbd85fdb6d2 - sha256: a01fcb9c3346ee08aa24b3900a08896f2e8f80c891378a57d71764e16bbd6141 + md5: 81f740407b45e3f9047b3174fa94eb9e + sha256: 56955610c0747ea7cb026bb8aa9ef165ff41d616e89894538173b8b7dd2ee49a build: hd590300_0 arch: x86_64 subdir: linux-64 build_number: 0 license: MIT license_family: MIT - size: 895713 - timestamp: 1696647097478 + size: 898045 + timestamp: 1707104384997 - platform: linux-64 name: xorg-kbproto version: 1.0.7 diff --git a/plugins/README.md b/plugins/README.md index 9038375..0f70039 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -6,16 +6,9 @@ Directory containing the plugins, i.e. Python packages declaring the We should have - [x] fluidfft-mpi4pyfft (cannot be tested because mpi4py-fft installation fails) -- [ ] fluidfft-fftw -- [ ] fluidfft-mpi_with_fftw -- [ ] fluidfft-fftwmpi +- [x] fluidfft-fftw +- [x] fluidfft-mpi_with_fftw +- [x] fluidfft-fftwmpi - [ ] fluidfft-p3dfft - [ ] fluidfft-pfft - [ ] fluidfft-pyvkfft (https://pyvkfft.readthedocs.io) - -Currently, we have only one tested plugin (fluidfft-pyfftw), which was written to -design and test the plugin machinery. However, I (PA) think that this (pure Python) -code will have to go back in fluidfft. Pyfftw can just be an optional dependency -for fluidfft. - -TODO: When we have other plugins, move back the code using pyfftw inside fluidfft. diff --git a/plugins/fluidfft-builder/fluidfft_builder/__init__.py b/plugins/fluidfft-builder/fluidfft_builder/__init__.py index c8bbe5c..7d39d4d 100644 --- a/plugins/fluidfft-builder/fluidfft_builder/__init__.py +++ b/plugins/fluidfft-builder/fluidfft_builder/__init__.py @@ -1,5 +1,7 @@ from pathlib import Path +from .create_fake_mod_for_doc import create_fake_modules + def print_include_dir(): src_cpp = Path(__file__).absolute().parent / "src_cpp" @@ -9,3 +11,6 @@ def print_include_dir(): def print_include_dir_cython(): include_cy = Path(__file__).absolute().parent / "include_cy" print(include_cy) + + +__all__ = ["create_fake_modules", "print_include_dir", "print_include_dir_cython"] diff --git a/plugins/fluidfft-builder/fluidfft_builder/create_fake_mod_for_doc.py b/plugins/fluidfft-builder/fluidfft_builder/create_fake_mod_for_doc.py index dc364a6..181484a 100644 --- a/plugins/fluidfft-builder/fluidfft_builder/create_fake_mod_for_doc.py +++ b/plugins/fluidfft-builder/fluidfft_builder/create_fake_mod_for_doc.py @@ -1,9 +1,10 @@ -import os +from importlib import resources +from pathlib import Path -here = os.path.abspath(os.path.split(__file__)[0]) +here = Path(__file__).absolute().parent -def get_doc(lines, indent=" "): +def get_docstring(lines, indent=" "): doc = None # find start doc @@ -59,7 +60,7 @@ def get_function_code(lines): indent = " " * 8 - doc = get_doc(lines_to_be_parsed, indent=indent) + doc = get_docstring(lines_to_be_parsed, indent=indent) if doc is None: doc = indent + "pass" @@ -70,10 +71,10 @@ def get_function_code(lines): def create_fake_mod(dimension): - with open( - os.path.join(here, "template{dim}d.pyx".format(dim=dimension)), "r" - ) as f: - lines_text = f.read().splitlines() + resource = resources.files("fluidfft_builder.templates") + with resources.as_file((resource / f"template{dimension}d.pyx")) as path: + with open(path, encoding="utf8") as file: + lines_text = file.read().splitlines() # find start class for i, line in enumerate(lines_text): @@ -81,8 +82,7 @@ def create_fake_mod(dimension): lines_class = lines_text[i + 1 :] break - # get docstring of the class - doc_class = get_doc(lines_class) + docstring_class = get_docstring(lines_class) lines_function_class = lines_class[1:] @@ -95,18 +95,26 @@ def create_fake_mod(dimension): functions_codes.append(get_function_code(lines_function_class[i:])) code = ( - "class FFT{dim}dFakeForDoc(object):\n".format(dim=dimension) - + doc_class + f"class FFT{dimension}dFakeForDoc(object):\n" + + docstring_class + "\n\n" + "\n\n".join(functions_codes) + "\n" ) - name = ( - "../../../../src/fluidfft/fft{dim}d/fake_mod_fft{dim}d_for_doc.py".format( - dim=dimension - ) + path_out = here / ( + f"../../../src/fluidfft/fft{dimension}d/" + f"fake_mod_fft{dimension}d_for_doc.py" ) - with open(os.path.join(here, name), "w") as f: - f.write(code) + if path_out.exists(): + old_text = path_out.read_text() + if old_text == code: + return + + path_out.write_text(code, encoding="utf8") + + +def create_fake_modules(): + for dimension in "23": + create_fake_mod(dimension) diff --git a/pyproject.toml b/pyproject.toml index 806dd01..441f731 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,20 +68,16 @@ package-dir = "src" [tool.pdm.dev-dependencies] build = ["meson-python", "ninja", "numpy", "transonic>=0.6.0", "pythran>=0.9.7"] -# plugins = [ -# "-e fluidfft-mpi4pyfft @ file:///${PROJECT_ROOT}/plugins/fluidfft-mpi4pyfft", -# ] - test = [ "pytest", "coverage", "pytest-cov", "cython", # needed at run time for coverage -] -dev = [ + # needed to build the plugins "pip", - "ipython", + "-e fluidfft-builder @ file:///${PROJECT_ROOT}/plugins/fluidfft-builder", ] +dev = ["ipython"] doc = [ "sphinx", "sphinx_copybutton", @@ -91,6 +87,8 @@ doc = [ "numpydoc", "pandas", "pyfftw", + # needed to create the dummy modules + "-e fluidfft-builder @ file:///${PROJECT_ROOT}/plugins/fluidfft-builder", ] lint = ["black", "pylint"] diff --git a/src/fluidfft/fft2d/__init__.py b/src/fluidfft/fft2d/__init__.py index 088993f..ceac080 100644 --- a/src/fluidfft/fft2d/__init__.py +++ b/src/fluidfft/fft2d/__init__.py @@ -2,14 +2,7 @@ ============================================================ This package contains extension modules containing classes for performing Fast -Fourier Transform with different methods and libraries. The number of classes -depend on how fluidfft has been compiled. The 2d classes currently implemented -are: - -- :class:`fluidfft.fft2d.with_fftw1d.FFT2DWithFFTW1D` -- :class:`fluidfft.fft2d.with_fftw2d.FFT2DWithFFTW2D` -- :class:`fluidfft.fft2d.mpi_with_fftwmpi2d.FFT2DMPIWithFFTW1D` -- :class:`fluidfft.fft2d.mpi_with_fftwmpi2d.FFT2DMPIWithFFTWMPI2D` +Fourier Transform with different methods and libraries. To use the FFT classes in real codes, it is simpler and recommended to use the class :class:`fluidfft.fft2d.operators.OperatorsPseudoSpectral2D` defined in @@ -41,10 +34,8 @@ class :class:`fluidfft.fft2d.operators.OperatorsPseudoSpectral2D` defined in "get_classes_mpi", ] -try: +if "sphinx" in sys.modules: from .fake_mod_fft2d_for_doc import FFT2dFakeForDoc -except ImportError: - pass def get_classes_seq(): diff --git a/src/fluidfft/fft2d/meson.build b/src/fluidfft/fft2d/meson.build index 6736548..610b490 100644 --- a/src/fluidfft/fft2d/meson.build +++ b/src/fluidfft/fft2d/meson.build @@ -6,6 +6,11 @@ python_sources = [ 'testing.py', ] +fs = import('fs') +if fs.is_file('fake_mod_fft2d_for_doc.py') + python_sources += ['fake_mod_fft2d_for_doc.py'] +endif + py.install_sources( python_sources, subdir: 'fluidfft/fft2d' diff --git a/src/fluidfft/fft3d/__init__.py b/src/fluidfft/fft3d/__init__.py index fa61786..cafade1 100644 --- a/src/fluidfft/fft3d/__init__.py +++ b/src/fluidfft/fft3d/__init__.py @@ -2,18 +2,7 @@ ============================================================ This package contains extension modules containing classes for performing Fast -Fourier Transform with different methods and libraries. The number of classes -depend on how fluidfft has been compiled. The 3d classes currently implemented -are: - -- :class:`fluidfft3d.with_fftw3d.FFT3DWithFFTW3D` -- :class:`fluidfft3d.with_cufft.FFT3DWithCUFFT` -- :class:`fluidfft3d.mpi_with_fftwmpi3d.FFT3DMPIWithFFTWMPI3D` -- :class:`fluidfft3d.mpi_with_fftwmpi3d.FFT3DMPIWithFFTW1D` -- :class:`fluidfft3d.mpi_with_pfft.FFT3DMPIWithPFFT` -- :class:`fluidfft3d.mpi_with_p3dfft.FFT3DMPIWithP3DFFT` -- :class:`fluidfft3d.mpi_with_mpi4pyfft.FFT3DMPIWithMPI4PYFFT` -- :class:`fluidfft3d.mpi_with_mpi4pyfft_slab.FFT3DMPIWithMPI4PYFFTSlab` +Fourier Transform with different methods and libraries. To use the FFT classes in real codes, it is simpler and recommended to use the class :class:`fluidfft.fft3d.operators.OperatorsPseudoSpectral3D` defined in @@ -45,10 +34,8 @@ class :class:`fluidfft.fft3d.operators.OperatorsPseudoSpectral3D` defined in "get_classes_mpi", ] -try: +if "sphinx" in sys.modules: from .fake_mod_fft3d_for_doc import FFT3dFakeForDoc -except ImportError: - pass def get_classes_seq(): diff --git a/src/fluidfft/fft3d/meson.build b/src/fluidfft/fft3d/meson.build index cf93d66..b61d81a 100644 --- a/src/fluidfft/fft3d/meson.build +++ b/src/fluidfft/fft3d/meson.build @@ -6,6 +6,11 @@ python_sources = [ 'with_pyfftw.py', ] +fs = import('fs') +if fs.is_file('fake_mod_fft3d_for_doc.py') + python_sources += ['fake_mod_fft3d_for_doc.py'] +endif + py.install_sources( python_sources, subdir: 'fluidfft/fft3d'