Skip to content

Commit

Permalink
demos as thumbnail nb-gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
pierricmora committed Mar 29, 2024
1 parent 160448d commit e0ddc5b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
8 changes: 4 additions & 4 deletions demo/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Time domain
| **Explicit** scheme
| *Wave propagation modeling*, *Spectral elements*
.. toctree::
.. nbgallery::
:maxdepth: 3
:titlesonly:
:glob:
Expand All @@ -28,7 +28,7 @@ Time domain
| **Implicit** scheme
| *Structural dynamics*
.. toctree::
.. nbgallery::
:maxdepth: 3
:titlesonly:
:glob:
Expand All @@ -39,7 +39,7 @@ Time domain
Frequency domain -- Helmoltz equation
-------------------------------------

.. toctree::
.. nbgallery::
:maxdepth: 3
:titlesonly:
:glob:
Expand All @@ -50,7 +50,7 @@ Frequency domain -- Helmoltz equation
Eigenmodes
----------

.. toctree::
.. nbgallery::
:maxdepth: 3
:titlesonly:
:glob:
Expand Down
2 changes: 1 addition & 1 deletion demo/freq_2D-SH_FullSpace.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
b_update_function=pde.update_b_frequencydomain)


# +
# + {"tags": ["nbsphinx-thumbnail"]}
# -----------------------------------------------------
# Ex 1: Solve for a single frequency
# -----------------------------------------------------
Expand Down
24 changes: 9 additions & 15 deletions docsrc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,11 @@

import datetime, sys, os

import pyvista
#pyvista.start_xvfb()
# necessary when building the sphinx gallery
pyvista.BUILDING_GALLERY = True
pyvista.OFF_SCREEN = True
pyvista.set_jupyter_backend("static")

import elastodynamicsx

# from shutil import copytree, ignore_patterns

# copytree('../demo/', 'demos/_cp_demo/', ignore=ignore_patterns('*.ipynb*', '*.npz', '__pycache__'), dirs_exist_ok=True)

os.environ['ELASTODYNAMICSX_DOCS_CFG'] = 'TRUE'

sys.path.insert(0, os.path.abspath('..'))

import elastodynamicsx

# General information about the project.
project = 'ElastodynamiCSx'
Expand Down Expand Up @@ -55,12 +44,16 @@
'sphinx_tabs.tabs',
'jupyter_sphinx',
"myst_parser",
'nbsphinx']
'nbsphinx',
'sphinx_copybutton',
]

nbsphinx_custom_formats = {
'.py': ['jupytext.reads', {'fmt': 'py:light'}],
}

copybutton_exclude = '.linenos, .gp'

# myst-parser is used to manage (readme) markdown file
# ref : https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
myst_enable_extensions = [
Expand All @@ -81,7 +74,8 @@
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**/.ipynb_checkpoints']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**/.ipynb_checkpoints',
'demos/_ln_demo/__init__.py', 'demos/_ln_demo/models', 'demos/_ln_demo/analyticalsolutions.py', 'conf.py']
autodoc_member_order = 'bysource'

# -- Options for HTML output -------------------------------------------------
Expand Down
10 changes: 9 additions & 1 deletion elastodynamicsx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@

"""Main module for ElastodynamiCSx"""

from ._version import __version__
from ._version import __version__ # noqa

from elastodynamicsx import pde, plot, solutions, solvers, utils

import os
# A simple flag to switch the jupyter_backend when building the docs
_DOCS_CFG = os.environ.get("ELASTODYNAMICSX_DOCS_CFG", "FALSE").upper() == "TRUE"

if _DOCS_CFG:
import pyvista
pyvista.set_jupyter_backend('static')

__all__ = ["pde", "plot", "solutions", "solvers", "utils"]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def run(self):
name='ElastodynamiCSx',
author="Pierric Mora",
author_email="[email protected]",
version=__version__,
version=__version__, # noqa
packages=setuptools.find_packages(),
url='https://github.com/Universite-Gustave-Eiffel/elastodynamicsx',
license='MIT License',
Expand Down

0 comments on commit e0ddc5b

Please sign in to comment.