From 51dd0e91066e07f4a64cf233e7068265daae5b91 Mon Sep 17 00:00:00 2001 From: Thomas Lecocq Date: Wed, 18 Sep 2024 19:20:57 +0200 Subject: [PATCH] improve the doc building --- doc/installation.rst | 7 ++++++- examples/plot_compute_hvsr.py | 5 +++-- examples/plot_compute_hvsr_psd.py | 5 +++-- examples/plot_interferogram.py | 10 ++++++---- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/doc/installation.rst b/doc/installation.rst index ff405d33..6139d78b 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -96,6 +96,11 @@ To build this documentation, some modules are required: pip install "sphinx_rtd_theme>1" pip install pillow==9.0.0 +If you plan to build the interaction examples, you'll need to download this link: + +.. todo:: ADD LINK TO THE BIG DATA REPO + +and define an environment variable ``MSNOISE_DOC`` with the path to where that data has been extracted. Then, this should simply work: @@ -103,7 +108,7 @@ Then, this should simply work: make html -it will create a .build folder containing the documentation. +it will create a .build/html folder containing the documentation. You can also build the doc to Latex and then use your favorite Latex-to-PDF tool. diff --git a/examples/plot_compute_hvsr.py b/examples/plot_compute_hvsr.py index 28dbfd49..913b066a 100644 --- a/examples/plot_compute_hvsr.py +++ b/examples/plot_compute_hvsr.py @@ -9,8 +9,9 @@ # Import & getting the data from the computed autocorrelations (ZZ, EE, NN) import os -if "SPHINX_DOC_BUILD" in os.environ or 1: - os.chdir(r"C:\tmp\MSNOISE_DOC") +if "SPHINX_DOC_BUILD" in os.environ: + if "MSNOISE_DOC" in os.environ: + os.chdir(os.environ["MSNOISE_DOC"]) import matplotlib matplotlib.use("agg") diff --git a/examples/plot_compute_hvsr_psd.py b/examples/plot_compute_hvsr_psd.py index 5f1e78f4..304dd8c6 100644 --- a/examples/plot_compute_hvsr_psd.py +++ b/examples/plot_compute_hvsr_psd.py @@ -13,8 +13,9 @@ import os -if "SPHINX_DOC_BUILD" in os.environ or 1: - os.chdir(r"C:\tmp\MSNOISE_DOC") +if "SPHINX_DOC_BUILD" in os.environ: + if "MSNOISE_DOC" in os.environ: + os.chdir(os.environ["MSNOISE_DOC"]) import matplotlib # matplotlib.use("agg") diff --git a/examples/plot_interferogram.py b/examples/plot_interferogram.py index d29e9eec..eabcde99 100644 --- a/examples/plot_interferogram.py +++ b/examples/plot_interferogram.py @@ -6,8 +6,9 @@ """ import os -if "SPHINX_DOC_BUILD" in os.environ or 1: - os.chdir(r"C:\tmp\MSNOISE_DOC") +if "SPHINX_DOC_BUILD" in os.environ: + if "MSNOISE_DOC" in os.environ: + os.chdir(os.environ["MSNOISE_DOC"]) import matplotlib matplotlib.use("agg") @@ -55,8 +56,9 @@ ############################################################# # Plotting the sub-daily stacks and zooming on +- 20 seconds: -if "SPHINX_DOC_BUILD" in os.environ or 1: - os.chdir(r"C:\tmp\MSNOISE_DOC") +if "SPHINX_DOC_BUILD" in os.environ: + if "MSNOISE_DOC" in os.environ: + os.chdir(os.environ["MSNOISE_DOC"]) # Get the last mov_stack configured: mov_stack = params.mov_stack[-1]