Skip to content

Commit c56f02d

Browse files
committed
docs: corrected api reference layout. Now explicited the modules instead of relying too much in autosummary. The latter is only used to create summary tables in the APi landing page. Renamed case_f to case_g. Fixed link to matplotlib docs. Added catch for floatcsep logger, to detect if sphinx is being used and relay to the general logger instead of floatlogger
build: updated requirements and rev_reqs
1 parent 05c08ea commit c56f02d

27 files changed

+970
-359
lines changed

docs/conf.py

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,54 +6,62 @@
66
import sys
77
from sphinx_gallery.sorting import FileNameSortKey
88

9-
sys.path.insert(0, os.path.abspath('..'))
9+
sys.path.insert(0, os.path.abspath(".."))
10+
11+
# NOTE: To expose sphinx warnings, comment `setup_logger()` in floatcsep.commands.main
12+
1013

1114
# -- Project information -----------------------------------------------------
1215

13-
project = 'floatCSEP'
14-
copyright = '2022, Pablo Iturrieta'
15-
author = 'Pablo Iturrieta'
16-
release = 'v0.1.0'
16+
project = "floatCSEP"
17+
copyright = "2022, Pablo Iturrieta"
18+
author = "Pablo Iturrieta"
19+
release = "v0.1.0"
1720

1821
# -- General configuration ---------------------------------------------------
1922

2023
extensions = [
21-
'sphinx.ext.autodoc',
22-
'sphinx.ext.todo',
23-
'sphinx.ext.autosummary',
24-
'sphinx.ext.coverage',
25-
'sphinx.ext.mathjax',
26-
'sphinx.ext.viewcode',
27-
'sphinx.ext.napoleon',
28-
'sphinx.ext.intersphinx',
29-
# 'sphinx_gallery.gen_gallery',
30-
# 'sphinx.ext.githubpages'
24+
"sphinx.ext.autodoc",
25+
"sphinx.ext.todo",
26+
"sphinx.ext.autosummary",
27+
"sphinx.ext.coverage",
28+
"sphinx.ext.mathjax",
29+
"sphinx.ext.viewcode",
30+
"sphinx.ext.napoleon",
31+
"sphinx.ext.intersphinx",
3132
]
3233

33-
templates_path = ['_templates']
34-
source_suffix = '.rst'
35-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
36-
pygments_style = 'default' # todo
37-
autodoc_typehints = 'none'
34+
# language = 'en'
35+
autosummary_generate = False
36+
autoclass_content = "both"
37+
suppress_warnings = [
38+
"autosummary",
39+
"autosummary.missing",
40+
]
41+
templates_path = ["_templates"]
42+
source_suffix = ".rst"
43+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
44+
pygments_style = "default"
45+
autodoc_typehints = "description"
3846
intersphinx_mapping = {
3947
"python": ("https://docs.python.org/3/", None),
4048
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
4149
"pandas": ("http://pandas.pydata.org/pandas-docs/stable/", None),
42-
"scipy": ('http://docs.scipy.org/doc/scipy/reference', None),
43-
"matplotlib": ('http://matplotlib.sourceforge.net/', None),
44-
'pycsep': ('https://docs.cseptesting.org/', None)
50+
"scipy": ("http://docs.scipy.org/doc/scipy/reference", None),
51+
"matplotlib": ("https://matplotlib.org/stable", None),
52+
"pycsep": ("https://docs.cseptesting.org/", None),
4553
}
4654
# -- Options for HTML output -------------------------------------------------
4755
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
4856

49-
html_theme = 'sphinx_rtd_theme'
50-
html_static_path = ['_static']
57+
html_theme = "sphinx_rtd_theme"
58+
html_static_path = ["_static"]
5159
html_theme_options = {
52-
'display_version': True,
53-
'prev_next_buttons_location': 'both',
54-
'collapse_navigation': False,
55-
'style_nav_header_background': '#343131ff',
56-
'logo_only': True,
60+
"display_version": True,
61+
"prev_next_buttons_location": "both",
62+
"collapse_navigation": False,
63+
"style_nav_header_background": "#343131ff",
64+
"logo_only": True,
5765
}
58-
html_logo = '_static/floatcsep_logo.svg'
66+
html_logo = "_static/floatcsep_logo.svg"
5967
todo_include_todos = False

docs/examples/case_f.rst renamed to docs/examples/case_g.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
A - Simple(st) Time-Dependent, Catalog-based Model
2-
==================================================
1+
G - Time-Dependent, Catalog-Based Model (from Source Code)
2+
==========================================================
33

44
.. currentmodule:: floatcsep
55

@@ -8,7 +8,7 @@ A - Simple(st) Time-Dependent, Catalog-based Model
88

99
.. admonition:: **TL; DR**
1010

11-
In a terminal, navigate to ``floatcsep/examples/case_f`` and type:
11+
In a terminal, navigate to ``floatcsep/examples/case_g`` and type:
1212

1313
.. code-block:: console
1414
@@ -23,7 +23,7 @@ Artifacts
2323
This example shows how a time-dependent model should be set up for a time-dependent experiment
2424
::
2525

26-
case_f
26+
case_g
2727
└── pymock
2828
├── input
2929
├── args.txt (model arguments)
@@ -49,7 +49,7 @@ The experiment's complexity increases from time-independent to dependent, since
4949

5050
1. The input data is, at the least, a catalog filtered until the forecast beginning, which is automatically allocated by ``fecsep`` in the `{model}/input` prior to each model's run. It is stored inside the model in ``csep.ascii`` format for simplicity's sake (see :doc:`pycsep:concepts/catalogs`).
5151

52-
.. literalinclude:: ../../examples/case_f/catalog.csv
52+
.. literalinclude:: ../../examples/case_g/catalog.csv
5353
:lines: 1-2
5454

5555
2. The input arguments controls how the source code works. The minimum arguments to run a model (which should be modified dynamically during an experiment) are the forecast ``start_date`` and ``end_date``. The experiment will read `{model}/input/args.txt` and change the values of ``start_date = {datetime}`` and ``end_date = {datetime}`' before the model is run. Additional arguments can be set by convenience, such as ``catalog`` (the input catalog name), ``n_sims`` (number of synthetic catalogs) and random ``seed`` for reproducibility.
@@ -80,7 +80,7 @@ Time
8080

8181
The configuration is identical to time-independent models, with the exception that now a ``horizon`` can be defined instead of ``intervals``, which is the forecast time-window length. The experiment's class should now be explicited as ``exp_class: td``
8282

83-
.. literalinclude:: ../../examples/case_f/config.yml
83+
.. literalinclude:: ../../examples/case_g/config.yml
8484
:language: yaml
8585
:lines: 3-7
8686

@@ -94,7 +94,7 @@ Models
9494

9595
Additional arguments should be passed to time-independent models.
9696

97-
.. literalinclude:: ../../examples/case_f/models.yml
97+
.. literalinclude:: ../../examples/case_g/models.yml
9898
:language: yaml
9999
:lines: 3-7
100100

@@ -110,7 +110,7 @@ Tests
110110
With time-dependent models, now catalog evaluations found in :obj:`csep.core.catalog_evaluations` can be used.
111111

112112

113-
.. literalinclude:: ../../examples/case_f/tests.yml
113+
.. literalinclude:: ../../examples/case_g/tests.yml
114114
:language: yaml
115115

116116
.. note::
@@ -120,7 +120,7 @@ Tests
120120
Running the experiment
121121
----------------------
122122

123-
The experiment can be run by simply navigating to the ``examples/case_f`` folder in the terminal and typing.
123+
The experiment can be run by simply navigating to the ``examples/case_g`` folder in the terminal and typing.
124124

125125
.. code-block:: console
126126

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Preliminary documentation.
2626
examples/case_c.rst
2727
examples/case_d.rst
2828
examples/case_e.rst
29-
examples/case_f.rst
29+
examples/case_g.rst
3030

3131

3232
.. toctree::
@@ -46,7 +46,7 @@ Preliminary documentation.
4646
deployment/intro.rst
4747

4848
.. toctree::
49-
:maxdepth: 2
49+
:maxdepth: 0
5050
:caption: Help & Reference
5151

5252
reference/api_reference

docs/intro/concepts.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A Floating Testing Experiment encapsulates each experiment into its own runnable
1313
evaluations.
1414

1515
``floatCSEP`` goals
16-
----------------
16+
-------------------
1717

1818
This is an application to deploy reproducible and prospective experiments of earthquake forecasting, namely a Floating Eperiment, that can operate independent of a particular testing server. With this application, researchers, institutions and users can
1919

0 commit comments

Comments
 (0)