Skip to content

Commit f61b578

Browse files
committed
docs: updated every tutorial with additional links to pycsep functions/classes. Added hints pointing users to advance documentation when a new concept is introduced. Added an extra section pyCSEP under the hood, so users can see which pyCSEP functions where used in the tutorials. Upgraded some typos in cases g and h, due to config.yml updates. Removed depreacted use_db from case_e.rst.
1 parent 590f86f commit f61b578

File tree

12 files changed

+440
-44
lines changed

12 files changed

+440
-44
lines changed

docs/intro/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ set this for the current terminal session:
110110
.. code-block:: console
111111
112112
$ export DYLD_FALLBACK_LIBRARY_PATH="/opt/homebrew/lib:/usr/local/lib:$DYLD_FALLBACK_LIBRARY_PATH"
113-
export DYLD_FALLBACK_LIBRARY_PATH="/opt/homebrew/lib:/usr/local/lib:$DYLD_FALLBACK_LIBRARY_PATH"
113+
114114
115115
Latest Stable Release
116116
---------------------

docs/tutorials/case_a.rst

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ The source code can be found in the ``tutorials/case_a`` folder or in `GitHub <
4242
└── config.yml
4343

4444

45-
* The testing region ``region.txt`` consists of a grid with two 1ºx1º bins, defined by its bottom-left nodes. The grid spacing is obtained automatically. The nodes are:
45+
* The testing region ``region.txt`` consists of a grid with two 1ºx1º bins, defined by its bottom-left nodes. (see :doc:`pycsep:concepts/regions` in **pyCSEP***)/ The grid spacing is obtained automatically. The nodes are:
4646

4747
.. literalinclude:: ../../tutorials/case_a/region.txt
4848
:caption: tutorials/case_a/region.txt
4949

50-
* The testing catalog ``catalog.csep`` contains only one event and is formatted in the :meth:`~pycsep.utils.readers.csep_ascii` style (see :doc:`pycsep:concepts/catalogs`). Catalog formats are detected automatically
50+
* The testing catalog ``catalog.csep`` contains only one event and is formatted in the :meth:`~pycsep.utils.readers.csep_ascii` style (see :doc:`pycsep:concepts/catalogs` in **pyCSEP***). Catalog formats are detected automatically
5151

5252
.. literalinclude:: ../../tutorials/case_a/catalog.csep
5353
:caption: tutorials/case_a/catalog.csep
5454

55-
* The forecast ``best_model.dat`` to be evaluated is written in the ``.dat`` format (see :doc:`pycsep:concepts/forecasts`). Forecast formats are detected automatically (see :mod:`floatcsep.utils.file_io.GriddedForecastParsers`)
55+
* The forecast ``best_model.dat`` to be evaluated is written in the ``.dat`` format (see :doc:`pycsep:concepts/forecasts` in **pyCSEP**). Forecast formats are detected automatically (see :mod:`floatcsep.utils.file_io.GriddedForecastParsers`)
5656

5757
.. literalinclude:: ../../tutorials/case_a/best_model.dat
5858
:caption: tutorials/case_a/best_model.dat
@@ -61,12 +61,12 @@ The source code can be found in the ``tutorials/case_a`` folder or in `GitHub <
6161
Configuration
6262
-------------
6363

64-
The experiment is defined by a time-, region-, model- and test-configurations, as well as a catalog and a region. In this example, they are written together in the ``config.yml`` file.
64+
The experiment is defined by a time-, region-, model- and test-configurations, as well as a catalog and a region. In this example, they are written together in the ``config.yml`` file.
6565

6666

67-
.. important::
67+
.. warning::
6868

69-
Every file path (e.g., of a catalog) specified in the ``config.yml`` file should be relative to the directory containing the configuration file.
69+
Every file path (e.g., of a catalog) specified in the ``config.yml`` file should be relative to the directory containing the configuration file.
7070

7171

7272

@@ -100,7 +100,7 @@ Region
100100
Catalog
101101
~~~~~~~
102102

103-
It is defined in the ``catalog`` inset. This should only make reference to a catalog **file** or a catalog **query function** (e.g. :func:`~csep.query_comcat`). **floatCSEP** will automatically filter the catalog to the experiment time, spatial and magnitude frames:
103+
It is defined in the ``catalog`` inset. This should only make reference to a catalog **file** or a catalog **query function** (see catalog loaders in :mod:`csep`). **floatCSEP** will automatically filter the catalog to the experiment time, spatial and magnitude frames:
104104

105105
.. literalinclude:: ../../tutorials/case_a/config.yml
106106
:caption: tutorials/case_a/config.yml
@@ -109,7 +109,7 @@ Catalog
109109

110110
Models
111111
~~~~~~
112-
The model configuration is set in the ``models`` inset with a list of model names, which specify their file paths (and other attributes). Here, we just set the path as ``best_model.dat``, whose format is automatically detected.
112+
The model configuration is set in the ``models`` inset with a list of model names, which specify their file paths (and other attributes). Here, we just set the path as ``best_model.dat``, whose format is automatically detected (see `Working with conventional gridded forecasts <https://docs.cseptesting.org/concepts/forecasts.html#working-with-conventional-gridded-forecasts>`_ in **pyCSEP**) .
113113

114114
.. literalinclude:: ../../tutorials/case_a/config.yml
115115
:caption: tutorials/case_a/config.yml
@@ -124,11 +124,22 @@ Evaluations
124124
~~~~~~~~~~~
125125
The experiment's evaluations are defined in the ``tests`` inset. It should be a list of test names making reference to their function and plotting function. These can be either from **pyCSEP** (see :doc:`pycsep:concepts/evaluations`) or defined manually. Here, we use the Poisson consistency N-test: its function is :func:`poisson_evaluations.number_test <csep.core.poisson_evaluations.number_test>` with a plotting function :func:`plot_poisson_consistency_test <csep.utils.plots.plot_poisson_consistency_test>`
126126

127-
.. literalinclude:: ../../tutorials/case_a/config.yml
128-
:caption: tutorials/case_a/config.yml
129-
:language: yaml
130-
:lines: 21-24
127+
.. literalinclude:: ../../tutorials/case_a/config.yml
128+
:caption: tutorials/case_a/config.yml
129+
:language: yaml
130+
:lines: 21-24
131+
132+
.. important::
133+
134+
See here all available `Evaluation Functions <https://floatcsep.readthedocs.io/en/latest/guide/evaluation_config.html#evaluations-functions>`_, along with their corresponding `Plotting Functions <https://floatcsep.readthedocs.io/en/latest/guide/evaluation_config.html#plotting-functions>`_.
135+
136+
.. note::
131137

138+
For further details on how to configure an experiment, models and evaluations, see:
139+
140+
- :ref:`experiment_config`
141+
- :ref:`model_config`
142+
- :ref:`evaluation_config`
132143

133144
Running the experiment
134145
----------------------
@@ -160,9 +171,25 @@ Results
160171
* The complete results are summarized in ``results/report.md``
161172

162173

163-
Advanced
164-
~~~~~~~~
174+
pyCSEP under the hood
175+
---------------------
176+
177+
This tutorial uses *floatCSEP* as the orchestrator, but relies on *pyCSEP* for functions and objects.
178+
179+
**Classes and functions used in this tutorial**
180+
181+
- Catalog: :py:class:`csep.core.catalogs.CSEPCatalog`
182+
183+
- :func:`csep.load_catalog`
165184

166-
The experiment run logic can be seen in the file ``case_a.py``, which executes the same example but in python source code. The run logic of the terminal commands ``run``, ``plot`` and ``reproduce`` can be found in :mod:`floatcsep.commands.main`, and can be customized by creating a script similar to ``case_a.py``.
185+
- Region: :py:class:`csep.core.regions.CartesianGrid2D`
186+
- Forecast class: :py:class:`csep.core.forecasts.GriddedForecast`
187+
- Test functions: :py:func:`csep.core.poisson_evaluations.number_test`
188+
- Result plotting functions: :py:func:`csep.utils.plots.plot_poisson_consistency_test`
167189

190+
**Where to learn pyCSEP further:**
168191

192+
- Catalogs: :doc:`pycsep:concepts/catalogs`
193+
- Regions: :doc:`pycsep:concepts/regions`
194+
- Forecasts: :doc:`pycsep:concepts/forecasts`
195+
- Evaluations: :doc:`pycsep:concepts/evaluations`

docs/tutorials/case_b.rst

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,19 @@ Evaluations
8888
:caption: tutorials/case_b/tests.yml
8989

9090
.. note::
91-
Plotting keyword arguments can be set in the ``plot_kwargs`` option - see :func:`~csep.utils.plots.plot_poisson_consistency_test` and :func:`~csep.utils.plots.plot_comparison_test` -.
91+
Plotting keyword arguments can be set in the ``plot_kwargs`` option (see :func:`~csep.utils.plots.plot_poisson_consistency_test` and :func:`~csep.utils.plots.plot_comparison_test`).
9292

9393
.. important::
94-
Comparison tests (such as the ``paired_t_test``) requires a reference model, whose name should be set in ``ref_model`` at the given test configuration.
94+
Comparison tests (such as the :py:func:`poisson_evaluations.paired_t_test <csep.core.poisson_evaluations.paired_t_test>`) requires a reference model, whose name should be set in ``ref_model`` at the given test configuration.See all available `Evaluation Functions <https://floatcsep.readthedocs.io/en/latest/guide/evaluation_config.html#evaluations-functions>`_ and `Plotting Functions <https://floatcsep.readthedocs.io/en/latest/guide/evaluation_config.html#plotting-functions>`_.
95+
96+
.. note::
97+
98+
For further details on how to configure an experiment, models and evaluations, see:
99+
100+
- :ref:`experiment_config`
101+
- :ref:`model_config`
102+
- :ref:`evaluation_config`
103+
95104

96105
Running the experiment
97106
----------------------
@@ -106,3 +115,39 @@ The experiment can be run by simply navigating to the ``tutorials/case_b`` folde
106115
This will automatically set all the file paths of the calculation (testing catalogs, evaluation results, figures) and will display a summarized report in ``results/report.md``.
107116

108117

118+
pyCSEP under the hood
119+
---------------------
120+
121+
This tutorial uses *floatCSEP* as the orchestrator, but relies on *pyCSEP* for functions and objects.
122+
123+
**Classes and functions used in this tutorial**
124+
125+
- Catalog: :py:class:`csep.core.catalogs.CSEPCatalog`
126+
127+
- :meth:`CSEPCatalog.write_json() <csep.core.catalogs.CSEPCatalog.write_json>`
128+
- :meth:`CSEPCatalog.load_json() <csep.core.catalogs.CSEPCatalog.load_json>`
129+
130+
- Region: :py:class:`csep.core.regions.CartesianGrid2D`
131+
- Forecast class: :py:class:`csep.core.forecasts.GriddedForecast`
132+
133+
- :meth:`floatcsep.utils.file_io.GriddedForecastParsers.csv`
134+
135+
- Test functions:
136+
137+
- :py:func:`csep.core.poisson_evaluations.number_test`
138+
- :py:func:`csep.core.poisson_evaluations.spatial_test`
139+
- :py:func:`csep.core.poisson_evaluations.magnitude_test`
140+
- :py:func:`csep.core.poisson_evaluations.conditional_likelihood_test`
141+
- :py:func:`csep.core.poisson_evaluations.paired_t_test`
142+
143+
- Result plotting functions:
144+
145+
- :py:func:`csep.utils.plots.plot_poisson_consistency_test`
146+
- :py:func:`csep.utils.plots.plot_comparison_test`
147+
148+
**Where to learn pyCSEP further:**
149+
150+
- :doc:`pycsep:concepts/catalogs`
151+
- :doc:`pycsep:concepts/regions`
152+
- :doc:`pycsep:concepts/forecasts`
153+
- :doc:`pycsep:concepts/evaluations`

docs/tutorials/case_c.rst

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ Evaluations
7878

7979
.. note::
8080

81-
Plot arguments (title, labels, font sizes, axes limits, etc.) can be passed as a dictionary in ``plot_args`` (see the arguments details in :func:`~csep.utils.plots.plot_poisson_consistency_test`)
81+
Plot arguments (title, labels, font sizes, axes limits, etc.) can be passed as a dictionary in ``plot_args`` (see the arguments details in :func:`~csep.utils.plot_poisson_consistency_test`)
82+
83+
.. important::
84+
85+
See here all available `Evaluation Functions <https://floatcsep.readthedocs.io/en/latest/guide/evaluation_config.html#evaluations-functions>`_ and their corresponding `Plotting Functions <https://floatcsep.readthedocs.io/en/latest/guide/evaluation_config.html#plotting-functions>`_.
86+
8287

8388
Results
8489
-------
@@ -99,3 +104,38 @@ now creates the result path tree for all time windows.
99104
The report shows the temporal evaluations for all time-windows, whereas the discrete evaluations are shown only for the last time window.
100105

101106

107+
108+
pyCSEP under the hood
109+
---------------------
110+
111+
This tutorial uses *floatCSEP* as the orchestrator, but relies on *pyCSEP* for functions and objects.
112+
113+
**Classes and functions used in this tutorial**
114+
115+
- Catalog: :py:class:`csep.core.catalogs.CSEPCatalog`
116+
117+
- :func:`csep.load_catalog`
118+
- :meth:`csep.core.catalogs.CSEPCatalog.write_json`
119+
120+
- Region: :py:class:`csep.core.regions.CartesianGrid2D`
121+
- Forecast class: :py:class:`csep.core.forecasts.GriddedForecast`
122+
123+
- :meth:`floatcsep.utils.file_io.GriddedForecastParsers.csv`
124+
125+
- Test functions:
126+
127+
- :py:func:`csep.core.poisson_evaluations.spatial_test`
128+
- :py:func:`floatcsep.utils.helpers.sequential_likelihood`
129+
- :py:func:`floatcsep.utils.helpers.sequential_information_gain`
130+
131+
- Result plotting functions:
132+
133+
- :py:func:`csep.utils.plots.plot_poisson_consistency_test`
134+
- :py:func:`floatcsep.utils.helpers.plot_sequential_likelihood`
135+
136+
**Where to learn pyCSEP further:**
137+
138+
- :doc:`pycsep:concepts/catalogs`
139+
- :doc:`pycsep:concepts/regions`
140+
- :doc:`pycsep:concepts/forecasts`
141+
- :doc:`pycsep:concepts/evaluations`

docs/tutorials/case_d.rst

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Once the catalog and models have been downloaded, the experiment structure will
6161
└── tests.yml
6262

6363
.. note::
64-
In this experiment no region file is needed, because the region is encoded in the forecasts themselves (QuadTree models, see https://zenodo.org/record/6289795 and https://zenodo.org/record/6255575 ).
64+
In this experiment no region file is needed because the region is encoded in the forecasts themselves, which are based on the QuadTree description (See `Working with quadtree-gridded forecasts <https://docs.cseptesting.org/concepts/forecasts.html#working-with-quadtree-gridded-forecasts>`_, and the Zenodo repositories https://zenodo.org/record/6289795 and https://zenodo.org/record/6255575 ).
6565

6666
Configuration
6767
-------------
@@ -120,3 +120,38 @@ Running the experiment
120120

121121

122122

123+
pyCSEP under the hood
124+
---------------------
125+
126+
This tutorial uses *floatCSEP* as the orchestrator, but relies on *pyCSEP* for functions and objects.
127+
128+
**Classes and functions used in this tutorial**
129+
130+
- Catalog: :py:class:`csep.core.catalogs.CSEPCatalog`
131+
132+
- :func:`csep.load_catalog`
133+
- :meth:`csep.core.catalogs.CSEPCatalog.write_json`
134+
135+
- Region: :py:class:`csep.core.regions.QuadtreeGrid2D`
136+
- Forecast class: :py:class:`csep.core.forecasts.GriddedForecast`
137+
138+
- :meth:`floatcsep.utils.file_io.GriddedForecastParsers.quadtree`
139+
140+
- Test functions:
141+
142+
- :py:func:`csep.core.poisson_evaluations.spatial_test`
143+
- :py:func:`csep.core.poisson_evaluations.paired_t_test`
144+
- :py:func:`floatcsep.utils.helpers.vector_poisson_t_w_test`
145+
146+
- Result plotting functions:
147+
148+
- :py:func:`csep.utils.plots.plot_poisson_consistency_test`
149+
- :py:func:`csep.utils.plots.plot_comparison_test`
150+
- :py:func:`floatcsep.utils.helpers.plot_matrix_comparative_test`
151+
152+
**Where to learn pyCSEP further:**
153+
154+
- :doc:`pycsep:concepts/catalogs`
155+
- :doc:`pycsep:concepts/regions`
156+
- :doc:`pycsep:concepts/forecasts`
157+
- :doc:`pycsep:concepts/evaluations`

docs/tutorials/case_e.rst

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ Models
9797

9898
The forecasts are defined in ``[Earthquakes / 10-years]``, which is specified with the ``forecast_unit`` option (The default is `forecast_unit: 1`).
9999

100-
.. note::
101-
102-
The ``use_db`` flag allows ``floatcsep`` to transform the forecasts into a database (HDF5), which speeds up the calculations.
103100

104101
Post-Process
105102
~~~~~~~~~~~~
@@ -144,6 +141,48 @@ Plot command
144141
145142
and re-run with the ``plot`` command. A forecast figure will re-appear in ``results/{window}/forecasts`` with a different colormap. Additional forecast and catalog plotting options can be found in the :func:`csep.utils.plots.plot_spatial_dataset` and :func:`csep.utils.plots.plot_catalog` ``pycsep`` functions.
146143

144+
.. note::
145+
146+
For further details on how to configure the **post-process** of an experiment, see:
147+
148+
- :ref:`postprocess`
149+
150+
151+
pyCSEP under the hood
152+
---------------------
153+
154+
This tutorial uses *floatCSEP* as the orchestrator, but relies on *pyCSEP* for functions and objects.
155+
156+
**Classes and functions used in this tutorial**
157+
158+
- Catalog: :py:class:`csep.core.catalogs.CSEPCatalog`
159+
160+
- :meth:`csep.core.catalogs.CSEPCatalog.load_json`
161+
- :meth:`csep.core.catalogs.CSEPCatalog.write_json`
162+
163+
- Region: :py:class:`csep.core.regions.italy_csep_region`
164+
- Forecast class: :py:class:`csep.core.forecasts.GriddedForecast`
165+
166+
- :meth:`floatcsep.utils.file_io.GriddedForecastParsers.xml`
167+
168+
- Test functions:
169+
170+
- :py:func:`csep.core.poisson_evaluations.spatial_test`
171+
- :py:func:`floatcsep.utils.helpers.sequential_likelihood`
172+
173+
- Result plotting functions:
174+
175+
- :py:func:`csep.utils.plots.plot_poisson_consistency_test`
176+
- :py:func:`floatcsep.utils.helpers.plot_sequential_likelihood`
177+
178+
179+
**Where to learn pyCSEP further:**
180+
181+
- :doc:`pycsep:concepts/catalogs`
182+
- :doc:`pycsep:concepts/regions`
183+
- :doc:`pycsep:concepts/forecasts`
184+
- :doc:`pycsep:concepts/evaluations`
185+
147186

148187
.. _case_e_references:
149188

0 commit comments

Comments
 (0)