pySTEPS / cookiecutter-pysteps-diagnostics-plugin

Other
0 stars 0 forks source link

.. IMPORTANT:: The plugins support in pysteps is only available for versions >=1.4.

Cookiecutter Pysteps-diagnostics-plugin

.. README_BEGIN_TAG

Cookiecutter template for Pysteps diagnostic postprocessing plugins. Cookiecutter_ is a command-line utility to creates python packages projects from templates, called "cookiecutters."

.. _Cookiecutter: https://cookiecutter.readthedocs.io

.. _how_plugins_work:

How do the plugins work?

When the plugin is installed, it advertises the new diagnostic postprocessors to other packages (in our case, pysteps) using the python entry points specification_. These new diagnostic postprocessors are automatically discovered every time that the pysteps library is imported. The discovered diagnostic postprocessors are added as attributes to the postprocessing.diagnostics module and registered to the postprocessing.get_method interface without any user intervention. In addition, since the plugins' installation does not modify the actual pysteps installation (i.e., the pysteps sources), the pysteps library can be updated without reinstalling the plugin.

.. _entry points specification: https://packaging.python.org/specifications/entry-points/

Quickstart

Install the latest Cookiecutter::

pip install -U cookiecutter

To generate a skeleton for a Pysteps plugin in the current folder, simply run::

cookiecutter https://github.com/pysteps/cookiecutter-pysteps-diagnostics-plugin

The above command will prompt the user to enter the following values used to generate a skeleton for the plugin package:

.. README_END_TAG

.. CREDITS_BEGIN_TAG

Credits

The cookiecutter-pysteps-plugin template was adapted from the cookiecutter-pypackage_ template.

.. _cookiecutter-pypackage: https://github.com/audreyfeldroy/cookiecutter-pypackage

.. CREDITS_END_TAG