Skip to content

Commit

Permalink
Minimal change to get doc built
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 24, 2024
1 parent 0716c33 commit a52326f
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 138 deletions.
18 changes: 0 additions & 18 deletions doc/HOWTO_build_the_doc

This file was deleted.

52 changes: 33 additions & 19 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@

plt.ioff()

from fluiddoc.ipynb_maker import execute_notebooks
from fluiddyn.util import modification_date

import fluidfft
import fluidfft.bench_analysis
from fluidfft.bench_analysis import plot_scaling

execute_notebooks("ipynb")
nbsphinx_execute = "never"

here = os.path.dirname(__file__)
here_tmp = os.path.join(here, "tmp")
html = os.path.join(here, "_build/html")
Expand Down Expand Up @@ -70,9 +66,9 @@ def save_fig_scaling(dir_name, dim, n0, n1, n2=None):
path_dir = os.path.join(path_fluidfft_bench_results, dir_name)
path_fig = os.path.join(here_tmp, "fig_" + dir_name + ".png")

if not os.path.exists(path_fig) or modification_date(
path_dir
) > modification_date(path_fig):
if not os.path.exists(path_fig) or modification_date(path_dir) > modification_date(
path_fig
):
print("make fig", path_fig)
fig = plot_scaling(path_dir, None, dim, n0, n1, n2, show=False)
fig.savefig(path_fig)
Expand Down Expand Up @@ -113,13 +109,12 @@ def save_fig_scaling(dir_name, dim, n0, n1, n2=None):
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.todo",
# 'sphinx.ext.pngmath',
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.autosummary",
"numpydoc",
"nbsphinx",
"sphinx_copybutton",
"myst_nb",
# 'fluiddoc.mathmacro',
# 'breathe'
]
Expand Down Expand Up @@ -168,13 +163,6 @@ def save_fig_scaling(dir_name, dim, n0, n1, n2=None):
# directories to ignore when looking for source files.
exclude_patterns = ["_build", "install/blas_libs.rst"]
paths_notebooks = Path("ipynb").glob("*.ipynb")
exclude_patterns.extend(
[
f"ipynb/{path.name}"
for path in paths_notebooks
if not path.name.endswith(".executed.ipynb")
]
)

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand Down Expand Up @@ -328,9 +316,7 @@ def save_fig_scaling(dir_name, dim, n0, n1, n2=None):

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
("index", "FluidFFT", "FluidFFT Documentation", ["Pierre Augier"], 1)
]
man_pages = [("index", "FluidFFT", "FluidFFT Documentation", ["Pierre Augier"], 1)]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand Down Expand Up @@ -373,3 +359,31 @@ def save_fig_scaling(dir_name, dim, n0, n1, n2=None):
autodoc_member_order = "bysource"

todo_include_todos = True

# Execute ipynb files into with a cache ...
nb_execution_mode = "cache"
nb_execution_cache_path = "./_build/jupyter_cache"
os.makedirs(nb_execution_cache_path, exist_ok=True)
# ... except these ipynb files
nb_execution_excludepatterns = ["ipynb/executed/*"]

nb_execution_raise_on_error = True
nb_execution_show_tb = True
nb_merge_streams = True

myst_enable_extensions = [
"amsmath",
# "attrs_inline",
"colon_fence",
# "deflist",
"dollarmath",
# "fieldlist",
# "linkify",
# "replacements",
# "smartquotes",
# "strikethrough",
"substitution",
# "tasklist",
]

suppress_warnings = ["mystnb.unknown_mime_type"]
4 changes: 2 additions & 2 deletions doc/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ simpler to use directly the "operators" classes
.. toctree::
:maxdepth: 1

ipynb/tuto_fft2d_seq.executed
ipynb/tuto_fft2d_seq.ipynb
ipynb/executed/tuto_fft2d_mpi
ipynb/executed/tuto_fft2d_mpi_domain_decomp
ipynb/tuto_fft3d_seq.executed
ipynb/tuto_fft3d_seq.ipynb
ipynb/executed/tuto_fft3d_mpi
ipynb/executed/tuto_fft3d_mpi_domain_decomp
Loading

0 comments on commit a52326f

Please sign in to comment.