-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contributing and overall doc comments (#1308)
### What kind of change does this PR introduce? * The CONTRIBUTING page has been moved to the top level of the repository. * Information concerning the licensing of xclim is clearly indicated in README. * `sphinx-autodoc-typehints` is now used to simplify call signatures generated in documentation. * The SDBA module API is now found with the rest of the User API documentation. * `HISTORY.rst` has been renamed `CHANGES.rst`, to follow `dask`-like conventions. * Hyperlink targets for individual `indices` and `indicators` now point to their entries under `API` or `Indices`. * Module-level docstrings have migrated from the library scripts directly into the documentation RestructuredText files. * The documentation now includes a page explaining the reasons for developing `xclim` and a section briefly detailing similar and related projects. * Markdown explanations in some Jupyter Notebooks have been edited for clarity * Removed `Mapping` abstract base class types in call signatures (`dict` variables were always expected). ### Does this PR introduce a breaking change? Yes. The docs have been completely reorganized.
- Loading branch information
Showing
70 changed files
with
617 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,64 @@ | ||
Spatial Analogues | ||
================= | ||
|
||
.. automodule:: xclim.analog | ||
:members: spatial_analogs | ||
:noindex: | ||
Spatial analogues are maps showing which areas have a present-day climate that is analogous to the future climate of a | ||
given place. This type of map can be useful for climate adaptation to see how regions are coping today under | ||
specific climate conditions. For example, officials from a city located in a temperate region that may be expecting more | ||
heatwaves in the future can learn from the experience of another city where heatwaves are a common occurrence, | ||
leading to more proactive intervention plans to better deal with new climate conditions. | ||
|
||
Spatial analogues are estimated by comparing the distribution of climate indices computed at the target location over | ||
the future period with the distribution of the same climate indices computed over a reference period for multiple | ||
candidate regions. A number of methodological choices thus enter the computation: | ||
|
||
Analogue metrics API | ||
-------------------- | ||
- Climate indices of interest, | ||
- Metrics measuring the difference between the distributions of indices, | ||
- Reference data from which to compute the base indices, | ||
- A future climate scenario to compute the target indices. | ||
|
||
.. autofunction:: xclim.analog.friedman_rafsky | ||
:noindex: | ||
The climate indices chosen to compute the spatial analogues are usually annual values of indices relevant to the | ||
intended audience of these maps. For example, in the case of the wine grape industry, the climate indices examined could | ||
include the length of the frost-free season, growing degree-days, annual winter minimum temperature and annual number of | ||
very cold days :cite:p:`roy_probabilistic_2017`. | ||
|
||
.. autofunction:: xclim.analog.kldiv | ||
:noindex: | ||
See :ref:`notebooks/analogs:Spatial Analogues examples`. | ||
|
||
.. autofunction:: xclim.analog.kolmogorov_smirnov | ||
:noindex: | ||
Methods to compute the (dis)similarity between samples | ||
------------------------------------------------------ | ||
This module implements all methods described in :cite:cts:`grenier_assessment_2013` to measure the dissimilarity between | ||
two samples, as well as the Székely-Rizzo energy distance. Some of these algorithms can be used to test whether two samples | ||
have been drawn from the same distribution. Here, they are used in finding areas with analogue climate conditions to a | ||
target climate: | ||
|
||
.. autofunction:: xclim.analog.nearest_neighbor | ||
:noindex: | ||
* Standardized Euclidean distance | ||
* Nearest Neighbour distance | ||
* Zech-Aslan energy statistic | ||
* Székely-Rizzo energy distance | ||
* Friedman-Rafsky runs statistic | ||
* Kolmogorov-Smirnov statistic | ||
* Kullback-Leibler divergence | ||
|
||
.. autofunction:: xclim.analog.seuclidean | ||
:noindex: | ||
All methods accept arrays, the first is the reference (n, D) and the second is the candidate (m, D). Where the climate | ||
indicators vary along D and the distribution dimension along n or m. All methods output a single float. See their | ||
documentation in :ref:`analogues:Analogues Metrics API`. | ||
|
||
.. autofunction:: xclim.analog.szekely_rizzo | ||
:noindex: | ||
.. warning:: | ||
|
||
.. autofunction:: xclim.analog.zech_aslan | ||
:noindex: | ||
Some methods are scale-invariant and others are not. This is indicated in the docstring | ||
of the methods as it can change the results significantly. In most cases, scale-invariance | ||
is desirable and inputs may need to be scaled beforehand for scale-dependent methods. | ||
|
||
Utilities for developers | ||
------------------------ | ||
.. rubric:: References | ||
|
||
.. autofunction:: xclim.analog.metric | ||
:noindex: | ||
:cite:cts:`roy_probabilistic_2017` | ||
:cite:cts:`grenier_assessment_2013` | ||
|
||
.. autofunction:: xclim.analog.standardize | ||
:noindex: | ||
Analogues Metrics API | ||
--------------------- | ||
|
||
See: :ref:`spatial-analogues-api` | ||
|
||
Analogues Developer Functions | ||
----------------------------- | ||
|
||
See: :ref:`spatial-analogues-developer-api` |
Oops, something went wrong.