From 743ee40a3451c16687c99710f1663662e21ccf63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Fr=C3=B6se?= Date: Fri, 8 Sep 2023 16:01:57 +0200 Subject: [PATCH] move examples to user-guide --- docs/Makefile | 13 ++++++++----- docs/conf.py | 17 ++++++++--------- docs/user-guide/examples/README.txt | 6 ++++++ .../user-guide/examples/algorithms/README.txt | 0 .../algorithms/convert_images_to_2d.py | 0 .../examples/algorithms/dilate_image.py | 0 .../examples/algorithms/nd_interpolation.py | 0 .../examples/core/InstrumentDescription.py | 0 .../user-guide/examples/core/README.txt | 0 .../examples/core/command_line_tools.py | 0 .../user-guide}/examples/core/config.json | 0 .../user-guide}/examples/core/containers.py | 0 .../user-guide}/examples/core/provenance.py | 0 .../examples/core/table_writer_reader.py | 0 .../user-guide/examples/tutorials/README.txt | 4 ++-- .../tutorials/calibrated_data_exploration.py | 0 .../examples/tutorials/coordinates_example.py | 0 .../examples/tutorials/ctapipe_handson.py | 0 .../examples/tutorials/ctapipe_overview.py | 0 .../examples/tutorials/ground_frame.png | Bin .../examples/tutorials/raw_data_exploration.py | 0 .../examples/tutorials/theta_square.py | 0 .../examples/tutorials/tilted_ground_frame.png | Bin .../examples/visualization/README.txt | 0 .../examples/visualization/array_display.py | 0 .../examples/visualization/camera_display.py | 0 examples/examples/README.txt | 6 ------ 27 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 docs/user-guide/examples/README.txt rename examples/examples/algorithms/README.rst => docs/user-guide/examples/algorithms/README.txt (100%) rename {examples => docs/user-guide}/examples/algorithms/convert_images_to_2d.py (100%) rename {examples => docs/user-guide}/examples/algorithms/dilate_image.py (100%) rename {examples => docs/user-guide}/examples/algorithms/nd_interpolation.py (100%) rename {examples => docs/user-guide}/examples/core/InstrumentDescription.py (100%) rename examples/examples/core/README.rst => docs/user-guide/examples/core/README.txt (100%) rename {examples => docs/user-guide}/examples/core/command_line_tools.py (100%) rename {examples => docs/user-guide}/examples/core/config.json (100%) rename {examples => docs/user-guide}/examples/core/containers.py (100%) rename {examples => docs/user-guide}/examples/core/provenance.py (100%) rename {examples => docs/user-guide}/examples/core/table_writer_reader.py (100%) rename examples/examples/tutorials/README.rst => docs/user-guide/examples/tutorials/README.txt (70%) rename {examples => docs/user-guide}/examples/tutorials/calibrated_data_exploration.py (100%) rename {examples => docs/user-guide}/examples/tutorials/coordinates_example.py (100%) rename {examples => docs/user-guide}/examples/tutorials/ctapipe_handson.py (100%) rename {examples => docs/user-guide}/examples/tutorials/ctapipe_overview.py (100%) rename {examples => docs/user-guide}/examples/tutorials/ground_frame.png (100%) rename {examples => docs/user-guide}/examples/tutorials/raw_data_exploration.py (100%) rename {examples => docs/user-guide}/examples/tutorials/theta_square.py (100%) rename {examples => docs/user-guide}/examples/tutorials/tilted_ground_frame.png (100%) rename examples/examples/visualization/README.rst => docs/user-guide/examples/visualization/README.txt (100%) rename {examples => docs/user-guide}/examples/visualization/array_display.py (100%) rename {examples => docs/user-guide}/examples/visualization/camera_display.py (100%) delete mode 100644 examples/examples/README.txt diff --git a/docs/Makefile b/docs/Makefile index 238eb0226ea..f619b16a1fd 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -15,15 +15,18 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile examples +%: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -examples: - mkdir -p user-guide/examples - clean: rm -rf api - rm -rf user-guide/examples + rm -rf user-guide/examples/*.zip + rm -rf user-guide/examples/*.rst + rm -rf user-guide/examples/*/*.ipynb + rm -rf user-guide/examples/*/*.py.md5 + rm -rf user-guide/examples/*/*.pickle + rm -rf user-guide/examples/*/*.rst + rm -rf user-guide/examples/*/images @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py index 9f453a9dbfc..cc1ed9538c9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -150,22 +150,22 @@ def setup(app): sphinx_gallery_conf = { "examples_dirs": [ - "../examples/examples", + "user-guide/examples", ], # path to your example scripts "gallery_dirs": [ "user-guide/examples", ], # path to where to save gallery generated output "subsection_order": ExplicitOrder( [ - "../examples/examples/algorithms", - "../examples/examples/core", - "../examples/examples/visualization", - "../examples/examples/tutorials", + "user-guide/examples/tutorials", + "user-guide/examples/algorithms", + "user-guide/examples/core", + "user-guide/examples/visualization", ] ), "within_subsection_order": FileNameSortKey, "nested_sections": False, - "copyfile_regex": r"index.rst|.*\.png|.*\.json", + # "copyfile_regex": r".*\.rst|.*\.png|.*\.json", "filename_pattern": r".*\.py", "promote_jupyter_magic": True, "line_numbers": True, @@ -229,8 +229,7 @@ def setup(app): "changes", "user-guide/examples/*/*.ipynb", "user-guide/examples/*/*.py", - "user-guide/tutorials/*.ipynb", - "user-guide/tutorials/*.py", + "user-guide/examples/*/README.rst", ] # The name of the Pygments (syntax highlighting) style to use. @@ -245,7 +244,7 @@ def setup(app): # Define the json_url for our version switcher. json_url = "https://ctapipe.readthedocs.io/en/latest/_static/switcher.json" -# Define the version we use for matching in the version switcher. +# Define the version we use for matching in the version switcher., version_match = os.getenv("READTHEDOCS_VERSION") # If READTHEDOCS_VERSION doesn't exist, we're not on RTD # If it is an integer, we're in a PR build and the version isn't correct. diff --git a/docs/user-guide/examples/README.txt b/docs/user-guide/examples/README.txt new file mode 100644 index 00000000000..7bdf1b8226f --- /dev/null +++ b/docs/user-guide/examples/README.txt @@ -0,0 +1,6 @@ +.. _tutorials_and_examples_gallery: + +Tutorials and Examples gallery +============================== + +This gallery provides an overview of different ctapipe modules and how to use them. diff --git a/examples/examples/algorithms/README.rst b/docs/user-guide/examples/algorithms/README.txt similarity index 100% rename from examples/examples/algorithms/README.rst rename to docs/user-guide/examples/algorithms/README.txt diff --git a/examples/examples/algorithms/convert_images_to_2d.py b/docs/user-guide/examples/algorithms/convert_images_to_2d.py similarity index 100% rename from examples/examples/algorithms/convert_images_to_2d.py rename to docs/user-guide/examples/algorithms/convert_images_to_2d.py diff --git a/examples/examples/algorithms/dilate_image.py b/docs/user-guide/examples/algorithms/dilate_image.py similarity index 100% rename from examples/examples/algorithms/dilate_image.py rename to docs/user-guide/examples/algorithms/dilate_image.py diff --git a/examples/examples/algorithms/nd_interpolation.py b/docs/user-guide/examples/algorithms/nd_interpolation.py similarity index 100% rename from examples/examples/algorithms/nd_interpolation.py rename to docs/user-guide/examples/algorithms/nd_interpolation.py diff --git a/examples/examples/core/InstrumentDescription.py b/docs/user-guide/examples/core/InstrumentDescription.py similarity index 100% rename from examples/examples/core/InstrumentDescription.py rename to docs/user-guide/examples/core/InstrumentDescription.py diff --git a/examples/examples/core/README.rst b/docs/user-guide/examples/core/README.txt similarity index 100% rename from examples/examples/core/README.rst rename to docs/user-guide/examples/core/README.txt diff --git a/examples/examples/core/command_line_tools.py b/docs/user-guide/examples/core/command_line_tools.py similarity index 100% rename from examples/examples/core/command_line_tools.py rename to docs/user-guide/examples/core/command_line_tools.py diff --git a/examples/examples/core/config.json b/docs/user-guide/examples/core/config.json similarity index 100% rename from examples/examples/core/config.json rename to docs/user-guide/examples/core/config.json diff --git a/examples/examples/core/containers.py b/docs/user-guide/examples/core/containers.py similarity index 100% rename from examples/examples/core/containers.py rename to docs/user-guide/examples/core/containers.py diff --git a/examples/examples/core/provenance.py b/docs/user-guide/examples/core/provenance.py similarity index 100% rename from examples/examples/core/provenance.py rename to docs/user-guide/examples/core/provenance.py diff --git a/examples/examples/core/table_writer_reader.py b/docs/user-guide/examples/core/table_writer_reader.py similarity index 100% rename from examples/examples/core/table_writer_reader.py rename to docs/user-guide/examples/core/table_writer_reader.py diff --git a/examples/examples/tutorials/README.rst b/docs/user-guide/examples/tutorials/README.txt similarity index 70% rename from examples/examples/tutorials/README.rst rename to docs/user-guide/examples/tutorials/README.txt index 58f643a3722..e8b6be88e86 100644 --- a/examples/examples/tutorials/README.rst +++ b/docs/user-guide/examples/tutorials/README.txt @@ -1,6 +1,6 @@ -.. _tutorials_gallery: +.. _tutorials: -Tutorials gallery +Tutorials ================= This gallery contains different tutorials of different use cases for ctapipe. diff --git a/examples/examples/tutorials/calibrated_data_exploration.py b/docs/user-guide/examples/tutorials/calibrated_data_exploration.py similarity index 100% rename from examples/examples/tutorials/calibrated_data_exploration.py rename to docs/user-guide/examples/tutorials/calibrated_data_exploration.py diff --git a/examples/examples/tutorials/coordinates_example.py b/docs/user-guide/examples/tutorials/coordinates_example.py similarity index 100% rename from examples/examples/tutorials/coordinates_example.py rename to docs/user-guide/examples/tutorials/coordinates_example.py diff --git a/examples/examples/tutorials/ctapipe_handson.py b/docs/user-guide/examples/tutorials/ctapipe_handson.py similarity index 100% rename from examples/examples/tutorials/ctapipe_handson.py rename to docs/user-guide/examples/tutorials/ctapipe_handson.py diff --git a/examples/examples/tutorials/ctapipe_overview.py b/docs/user-guide/examples/tutorials/ctapipe_overview.py similarity index 100% rename from examples/examples/tutorials/ctapipe_overview.py rename to docs/user-guide/examples/tutorials/ctapipe_overview.py diff --git a/examples/examples/tutorials/ground_frame.png b/docs/user-guide/examples/tutorials/ground_frame.png similarity index 100% rename from examples/examples/tutorials/ground_frame.png rename to docs/user-guide/examples/tutorials/ground_frame.png diff --git a/examples/examples/tutorials/raw_data_exploration.py b/docs/user-guide/examples/tutorials/raw_data_exploration.py similarity index 100% rename from examples/examples/tutorials/raw_data_exploration.py rename to docs/user-guide/examples/tutorials/raw_data_exploration.py diff --git a/examples/examples/tutorials/theta_square.py b/docs/user-guide/examples/tutorials/theta_square.py similarity index 100% rename from examples/examples/tutorials/theta_square.py rename to docs/user-guide/examples/tutorials/theta_square.py diff --git a/examples/examples/tutorials/tilted_ground_frame.png b/docs/user-guide/examples/tutorials/tilted_ground_frame.png similarity index 100% rename from examples/examples/tutorials/tilted_ground_frame.png rename to docs/user-guide/examples/tutorials/tilted_ground_frame.png diff --git a/examples/examples/visualization/README.rst b/docs/user-guide/examples/visualization/README.txt similarity index 100% rename from examples/examples/visualization/README.rst rename to docs/user-guide/examples/visualization/README.txt diff --git a/examples/examples/visualization/array_display.py b/docs/user-guide/examples/visualization/array_display.py similarity index 100% rename from examples/examples/visualization/array_display.py rename to docs/user-guide/examples/visualization/array_display.py diff --git a/examples/examples/visualization/camera_display.py b/docs/user-guide/examples/visualization/camera_display.py similarity index 100% rename from examples/examples/visualization/camera_display.py rename to docs/user-guide/examples/visualization/camera_display.py diff --git a/examples/examples/README.txt b/examples/examples/README.txt deleted file mode 100644 index d3c2423283f..00000000000 --- a/examples/examples/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -.. _examples_gallery: - -Examples gallery -================ - -The examples gallery provides an overview of different ctapipe modules and how to use them.