Skip to content

Commit ba2c811

Browse files
authored
Use new theme for docs (#259)
* Use new theme * Refactor index * Update title * Minor doc fixes * Remove missing module * Do not build pdf * Reintroduce author * Move interactive example to left sidebar * More consistent spelling of pysteps * Some cleanups in the docstrings * Remove pages not used anymore
1 parent 6752bad commit ba2c811

File tree

93 files changed

+465
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+465
-334
lines changed

.github/workflows/test_pysteps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Pysteps
1+
name: Test pysteps
22

33
env:
44
MINIMAL_DEPENDENCIES: cython numpy jsmin jsonschema matplotlib netCDF4 opencv pillow pyproj scipy dask

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sphinx:
77
configuration: doc/source/conf.py
88

99
formats:
10-
- pdf
10+
- htmlzip
1111

1212
python:
1313
version: 3.8

CONTRIBUTING.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Contributing to Pysteps
1+
Contributing to pysteps
22
=======================
33

4-
Welcome! pySTEPS is a community-driven initiative for developing and
4+
Welcome! Pysteps is a community-driven initiative for developing and
55
maintaining an easy to use, modular, free and open-source Python
66
framework for short-term ensemble prediction systems.
77

@@ -108,7 +108,7 @@ root::
108108

109109
The pre-commit hooks are scripts executed automatically in every commit to identify simple issues with the code.
110110
When an issue is identified (the pre-commit script exits with non-zero status), the hook aborts the commit and prints the error.
111-
Currently, Pysteps only tests that the code to be committed complies with black's format style.
111+
Currently, pysteps only tests that the code to be committed complies with black's format style.
112112
In case that the commit is aborted, you only need to run black in the entire source code.
113113
This can be done by running :code:`black .` or :code:`pre-commit run --all-files`.
114114
The latter is recommended since it indicates if the commit contained any formatting errors (that are automatically corrected).
@@ -310,7 +310,8 @@ Here is a summary of the most important rules:
310310
Here is an example of a docstring::
311311

312312
def adjust_lag2_corrcoef1(gamma_1, gamma_2):
313-
"""A simple adjustment of lag-2 temporal autocorrelation coefficient to
313+
"""
314+
A simple adjustment of lag-2 temporal autocorrelation coefficient to
314315
ensure that the resulting AR(2) process is stationary when the parameters
315316
are estimated from the Yule-Walker equations.
316317

@@ -364,7 +365,7 @@ Testing your changes
364365
~~~~~~~~~~~~~~~~~~~~
365366

366367
Before committing changes or creating pull requests, check that all the tests in the pysteps suite pass.
367-
See the `Testing pySTEPS <https://pysteps.readthedocs.io/en/latest/developer_guide/test_pysteps.html#testing-pysteps>`__
368+
See the `Testing pysteps <https://pysteps.readthedocs.io/en/latest/developer_guide/test_pysteps.html#testing-pysteps>`__
368369
for detailed instruction to run the tests.
369370

370371
Although it is not strictly needed, we suggest creating minimal tests for new contributions to ensure that it achieves
@@ -382,7 +383,7 @@ A quick way to get familiar with the pytest syntax and the testing procedures
382383
is checking the python scripts present in the pysteps test module.
383384

384385
Core developer guidelines
385-
~~~~~~~~~~~~~~~~~~~~~~~~
386+
~~~~~~~~~~~~~~~~~~~~~~~~~
386387

387388
Working directly on the master branch is discouraged and is reserved only
388389
for small changes and updates that do not compromise the stability of the code.
@@ -415,8 +416,7 @@ Processing pull requests
415416
.. _`Squash and merge`: https://github.com/blog/2141-squash-your-commits
416417

417418
To process the pull request, we follow similar rules to those used in the
418-
`mypy <https://github.com/python/mypy/blob/master/CONTRIBUTING.md#core-developer-guidelines>`_
419-
project:
419+
`mypy developer guidelines <https://github.com/python/mypy/blob/master/CONTRIBUTING.md#core-developer-guidelines>`_:
420420

421421
* Always wait for tests to pass before merging PRs.
422422
* Always use "`Squash and merge`_" to merge PRs.

PKG-INFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ License: LICENSE
77
Description: =======
88
pySteps
99
=======
10-
The pySTEPS initiative is a community that develops and maintains an easy to
10+
The pysteps initiative is a community that develops and maintains an easy to
1111
use, modular, free and open-source python framework for short-term ensemble
1212
prediction systems.
1313

1414
The focus is on probabilistic nowcasting of radar precipitation fields,
15-
but pySTEPS is designed to allow a wider range of uses.
15+
but pysteps is designed to allow a wider range of uses.
1616

1717
Platform: UNKNOWN

README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
=====================================================================
2-
pySTEPS - Python framework for short-term ensemble prediction systems
1+
pysteps - Python framework for short-term ensemble prediction systems
32
=====================================================================
43

54
.. start-badges
@@ -23,7 +22,7 @@ pySTEPS - Python framework for short-term ensemble prediction systems
2322
:target: https://pysteps.readthedocs.io/
2423

2524
.. |test| image:: https://github.com/pySTEPS/pysteps/workflows/Test%20Pysteps/badge.svg
26-
:alt: Test Pysteps
25+
:alt: Test pysteps
2726
:target: https://github.com/pySTEPS/pysteps/actions?query=workflow%3A"Test+Pysteps"
2827

2928
.. |black| image:: https://github.com/pySTEPS/pysteps/workflows/Check%20Black/badge.svg

ci/test_plugin_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
Script to test the plugin support.
55
6-
This script assumes that a package created with the default Pysteps plugin template
6+
This script assumes that a package created with the default pysteps plugin template
77
(and using the default values) is installed.
88
99
https://github.com/pySTEPS/cookiecutter-pysteps-plugin

doc/_static/pysteps_logo.png

51.8 KB
Loading

doc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Additional requeriments related to the documentation build only
22
sphinx
33
sphinxcontrib.bibtex
4-
sphinx_rtd_theme
4+
sphinx-book-theme
55
sphinx_gallery
66
scikit-image
77
pandas

doc/source/conf.py

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77
import subprocess
88
import sys
9+
from datetime import datetime
910

1011
import json
1112
from jsmin import jsmin
@@ -52,18 +53,16 @@
5253

5354
# General information about the project.
5455
project = "pysteps"
55-
copyright = "2020, PySteps developers"
56-
author = "PySteps developers"
56+
copyright = f"2018-{datetime.now():%Y}, pysteps developers"
57+
author = "pysteps developers"
5758

5859

5960
# The version info for the project you're documenting, acts as replacement for
6061
# |version| and |release|, also used in various other places throughout the
6162
# built documents.
6263
#
6364
def get_version():
64-
"""
65-
Returns project version as string from 'git describe' command.
66-
"""
65+
"""Returns project version as string from 'git describe' command."""
6766

6867
from subprocess import check_output
6968

@@ -136,13 +135,32 @@ def set_root():
136135
#
137136
# html_theme = 'alabaster'
138137
# html_theme = 'classic'
139-
html_theme = "sphinx_rtd_theme"
138+
html_theme = "sphinx_book_theme"
139+
html_title = ""
140+
141+
html_context = {
142+
"github_user": "pySTEPS",
143+
"github_repo": "pysteps",
144+
"github_version": "master",
145+
"doc_path": "doc",
146+
}
140147

141148
# Theme options are theme-specific and customize the look and feel of a theme
142149
# further. For a list of options available for each theme, see the
143150
# documentation.
144151
#
145-
# html_theme_options = {}
152+
html_theme_options = {
153+
"repository_url": "https://github.com/pySTEPS/pysteps",
154+
"repository_branch": "master",
155+
"path_to_docs": "doc/source",
156+
"use_edit_page_button": True,
157+
"use_repository_button": True,
158+
"use_issues_button": True,
159+
}
160+
161+
# The name of an image file (relative to this directory) to place at the top
162+
# of the sidebar.
163+
html_logo = "../_static/pysteps_logo.png"
146164

147165
# Add any paths that contain custom static files (such as style sheets) here,
148166
# relative to this directory. They are copied after the builtin static files,
@@ -155,12 +173,12 @@ def set_root():
155173
#
156174
# This is required for the alabaster theme
157175
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
158-
html_sidebars = {
159-
"**": [
160-
"relations.html", # needs 'show_related': True theme option to display
161-
"searchbox.html",
162-
]
163-
}
176+
# html_sidebars = {
177+
# "**": [
178+
# "relations.html", # needs 'show_related': True theme option to display
179+
# "searchbox.html",
180+
# ]
181+
# }
164182

165183
html_domain_indices = True
166184

@@ -211,15 +229,14 @@ def set_root():
211229
# (source start file, target name, title,
212230
# author, documentclass [howto, manual, or own class]).
213231
latex_documents = [
214-
(master_doc, "pysteps.tex", "pysteps Reference", author, "manual"),
232+
(master_doc, "pysteps.tex", "pysteps reference", author, "manual"),
215233
]
216234

217235
# -- Options for manual page output ---------------------------------------
218236

219237
# One entry per manual page. List of tuples
220238
# (source start file, name, description, authors, manual section).
221-
man_pages = [(master_doc, "pysteps", "pysteps Reference", [author], 1)]
222-
239+
man_pages = [(master_doc, "pysteps", "pysteps reference", [author], 1)]
223240
# -- Options for Texinfo output -------------------------------------------
224241

225242
# Grouping the document tree into Texinfo files. List of tuples
@@ -229,7 +246,7 @@ def set_root():
229246
(
230247
master_doc,
231248
"pysteps",
232-
"pysteps Reference",
249+
"pysteps reference",
233250
author,
234251
"pysteps",
235252
"One line description of project.",

doc/source/developer_guide/build_the_docs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ related to Sphinx that are specified in the doc/requirements.txt file:
3535
- sphinx
3636
- numpydoc
3737
- sphinxcontrib.bibtex
38-
- sphinx_rtd_theme
38+
- sphinx-book-theme
3939
- sphinx_gallery
4040

4141
You can install these packages running `pip install -r doc/requirements.txt`.

0 commit comments

Comments
 (0)