Skip to content

Commit

Permalink
Further fix of doc configuration and fix of ipython code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
gutzbenj committed Sep 21, 2020
1 parent e22c8e3 commit 7854683
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
10 changes: 5 additions & 5 deletions docs/conf.py
Expand Up @@ -16,6 +16,8 @@
import os
import sys
import tomlkit
import sphinx_material

sys.path.insert(0, os.path.abspath('..'))


Expand Down Expand Up @@ -51,13 +53,12 @@ def _get_project_meta():
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx_autodoc_typehints",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.autosectionlabel",
"sphinx_rtd_theme",
"sphinxcontrib.rsvgconverter",
"sphinx.ext.imgconverter",
"sphinxcontrib.rsvgconverter",
"sphinx_autodoc_typehints",
#"matplotlib.sphinxext.only_directives",
"matplotlib.sphinxext.plot_directive",
"IPython.sphinxext.ipython_directive",
Expand All @@ -78,7 +79,7 @@ def _get_project_meta():
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
# html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down Expand Up @@ -110,7 +111,6 @@ def _get_project_meta():


# -- Material options -------------------------------------------
import sphinx_material

html_show_sourcelink = True
html_sidebars = {
Expand Down
49 changes: 24 additions & 25 deletions docs/pages/tutorial.rst
Expand Up @@ -8,15 +8,15 @@ Prerequisites
=============
Import modules necessary for general functioning.

.. ipython::
.. ipython:: python
In [1]: import warnings
...: warnings.filterwarnings("ignore")
...: import wetterdienst
...: from wetterdienst import PeriodType, TimeResolution, Parameter
...: import matplotlib as mpl
...: import matplotlib.pyplot as plt
...: from matplotlib import cm
import warnings
warnings.filterwarnings("ignore")
import wetterdienst
from wetterdienst import PeriodType, TimeResolution, Parameter
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import cm
========
Expand All @@ -28,32 +28,31 @@ Which parameters are available?

All available combinations
==========================
.. ipython::
.. ipython:: python
In [2]: print(wetterdienst.discover_climate_observations())
print(wetterdienst.discover_climate_observations())
Daily historical data
=====================
.. ipython::
.. ipython:: python
In [3]: print("Selection of daily historical data")
...: print(
...: wetterdienst.discover_climate_observations(
...: time_resolution=TimeResolution.DAILY,
...: period_type=PeriodType.HISTORICAL
...: )
...: )
# Selection of daily historical data
print(
wetterdienst.discover_climate_observations(
time_resolution=TimeResolution.DAILY,
period_type=PeriodType.HISTORICAL
)
)
================
Get station list
================
.. ipython:: python
.. ipython::

In [1]: metadata_hdp = wetterdienst.metadata_for_climate_observations(
...: Parameter.PRECIPITATION_MORE, TimeResolution.DAILY, PeriodType.HISTORICAL)
...: print("Number of stations with available data: ", metadata_hdp["HAS_FILE"].sum())
...: print("Some of the stations:")
...: metadata_hdp.head()
metadata_hdp = wetterdienst.metadata_for_climate_observations(
Parameter.PRECIPITATION_MORE, TimeResolution.DAILY, PeriodType.HISTORICAL)
print("Number of stations with available data: ", metadata_hdp["HAS_FILE"].sum())
print("Some of the stations:")
metadata_hdp.head()

0 comments on commit 7854683

Please sign in to comment.