Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@ build:
conda:
environment: requirements/env_docs.yml

python:
install:
- method: pip
path: .
extra_requirements:
- doc

formats:
- pdf
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ Added:
Changed:

Removed:
- `nbsphinx` [#712](https://github.com/CLIMADA-project/climada_python/pull/712)
- `pandoc` [#712](https://github.com/CLIMADA-project/climada_python/pull/712)

### Added

- `Impact.impact_at_reg` method for aggregating impacts per country or custom region [#642](https://github.com/CLIMADA-project/climada_python/pull/642)
- `Impact.match_centroids` convenience method for matching (hazard) centroids to impact objects [#602](https://github.com/CLIMADA-project/climada_python/pull/602)
- `climada.util.coordinates.match_centroids` method for matching (hazard) centroids to GeoDataFrames [#602](https://github.com/CLIMADA-project/climada_python/pull/602)
- 'Extra' requirements `doc`, `test`, and `dev` for Python package [#712](https://github.com/CLIMADA-project/climada_python/pull/712)

### Changed

Expand All @@ -31,6 +34,7 @@ Removed:
- The sigmoid and step impact functions now require the user to define the hazard type. [#675](https://github.com/CLIMADA-project/climada_python/pull/675)
- Improved error messages produced by `ImpactCalc.impact()` in case hazard type is not found in exposures/impf_set [#691](https://github.com/CLIMADA-project/climada_python/pull/691)
- Tests with long runtime were moved to integration tests in `climada/test` [#709](https://github.com/CLIMADA-project/climada_python/pull/709)
- Use `myst-nb` for parsing Jupyter Notebooks for the documentation instead of `nbsphinx` [#712](https://github.com/CLIMADA-project/climada_python/pull/712)

### Fixed

Expand All @@ -40,6 +44,8 @@ Removed:

### Removed

- `requirements/env_developer.yml` environment specs. Use 'extra' requirements when installing the Python package instead [#712](https://github.com/CLIMADA-project/climada_python/pull/712)

## v3.3.2

Release date: 2023-03-02
Expand Down
33 changes: 23 additions & 10 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,10 @@
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx.ext.ifconfig',
'nbsphinx',
'myst_parser',
'myst_nb',
'sphinx_markdown_tables',
'readthedocs_ext.readthedocs',]

nbsphinx_allow_errors = True

# read the docs version used for links
if 'dev' in __version__:
read_docs_url = 'en/latest/'
Expand All @@ -54,12 +51,6 @@
# Add any paths that contain templates here, relative to this directory.
templates_path = []

# The suffix of source filenames.
source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}

# The encoding of source files.
#source_encoding = 'utf-8'

Expand Down Expand Up @@ -247,6 +238,28 @@ def remove_module_docstring(app, what, name, obj, options, lines):

autodoc_member_order = "bysource"

# --- MYST Parser settings ----

# Jupyter Notebooks will not be executed when creating the docs
nb_execution_mode = "off"

# Extensions, see https://myst-parser.readthedocs.io/en/latest/configuration.html#list-of-syntax-extensions
myst_enable_extensions = [
"amsmath",
"colon_fence",
"deflist",
"dollarmath",
"html_image",
]

# URI schemes that are converted to external links
myst_url_schemes = ("http", "https", "mailto")

# Generate heading anchors for linking to them, up to heading level 4
myst_heading_anchors = 4

# ---

def setup(app):
app.connect("autodoc-skip-member", skip)
app.connect("autodoc-process-docstring", remove_module_docstring)
Expand Down
8 changes: 4 additions & 4 deletions doc/guide/Guide_CLIMADA_Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"\n",
"## Content\n",
"\n",
"- [Why tutorials](#Why-tutorials)\n",
"- [Basic structure](#Basic-structure)\n",
"- [Good examples](#Good-examples)\n",
"- [Use only Markdown for headers and table of content](#Use-only-Markdown-for-headers-and-table-of-content)"
"- [Why tutorials](#why-tutorials)\n",
"- [Basic structure](#basic-structure)\n",
"- [Good examples](#good-examples)\n",
"- [Use only Markdown for headers and table of content](#use-only-markdown-for-headers-and-table-of-content)"
]
},
{
Expand Down
29 changes: 29 additions & 0 deletions doc/guide/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,35 @@ For advanced Python users or developers of CLIMADA, we recommed cloning the CLIM
If this test passes, great!
You are good to go.

Install Developer Dependencies (Optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Building the documentation and running the entire test suite of CLIMADA requires additional dependencies which are not installed by default.
They are also not needed for using CLIMADA.
However, if you want to develop CLIMADA, we recommend you install them.

With the ``climada_env`` activated, enter the workspace directory and then the CLIMADA repository as above.
Then, add the ``dev`` extra specification to the ``pip install`` command (**mind the quotation marks**, and see also `pip install examples <https://pip.pypa.io/en/stable/cli/pip_install/#examples>`_):

.. code-block:: shell

python -m pip install -e "./[dev]"

The CLIMADA Python package defines the following `extras <https://peps.python.org/pep-0508/#extras>`_:

.. list-table::
:header-rows: 1
:widths: 1 5

* - Extra
- Includes Dependencies...
* - ``doc``
- for building documentation
* - ``test``
- for running and evaluating tests
* - ``dev``
- combination of ``doc`` and ``test``

Install CLIMADA Petals (Optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
4 changes: 0 additions & 4 deletions requirements/env_climada.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,3 @@ dependencies:
- xarray>=2023.3
- xlrd>=2.0
- xlsxwriter>=3.0
- pip:
- deprecation>=2.1
- overpy>=0.6
- peewee>=3.16
22 changes: 0 additions & 22 deletions requirements/env_developer.yml

This file was deleted.

24 changes: 24 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@
with open(here.joinpath('README.md'), encoding='utf-8') as f:
long_description = f.read()

# Requirements for documentation
DEPS_DOC = [
"ipython",
"myst-nb",
"readthedocs-sphinx-ext>=2.2",
"sphinx",
"sphinx-book-theme",
"sphinx-markdown-tables",
]

# Requirements for testing
DEPS_TEST = [
"coverage>=7.2",
"ipython",
"mccabe>=0.6",
"pylint==2.7.1",
]

setup(
name='climada',

Expand Down Expand Up @@ -78,5 +96,11 @@
'xmlrunner'
],

extras_require={
"doc": DEPS_DOC,
"test": DEPS_TEST,
"dev": DEPS_DOC + DEPS_TEST
},

include_package_data=True
)