Skip to content

Commit

Permalink
Merge pull request earthobservations#173 from earthobservations/fix-d…
Browse files Browse the repository at this point in the history
…ocs-dependencies

Fix docs dependencies
  • Loading branch information
gutzbenj committed Sep 21, 2020
2 parents 53631bf + 8468e61 commit 624b56e
Show file tree
Hide file tree
Showing 6 changed files with 692 additions and 657 deletions.
3 changes: 2 additions & 1 deletion .readthedocs.yml
Expand Up @@ -19,4 +19,5 @@ python:
install:
- method: pip
path: .
- requirements: docs/requirements.txt
extra_requirements:
- docs
24 changes: 12 additions & 12 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 All @@ -97,20 +98,19 @@ def _get_project_meta():
# This value contains a list of modules to be mocked up. This is useful when
# some external dependencies are not met at build time and break the building process.
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_mock_imports
autodoc_mock_imports = [
"pandas",
"numpy",
"scipy",
"dateutil",
"dateparser",
]
# autodoc_mock_imports = [
# "pandas",
# "numpy",
# "scipy",
# "dateutil",
# "dateparser",
# ]

# Use docstring from both class-level and __init__ when documenting a class.
autoclass_content = "both"


# -- 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()
8 changes: 0 additions & 8 deletions docs/requirements.txt

This file was deleted.

0 comments on commit 624b56e

Please sign in to comment.