Important
The plugins support in pysteps is only available for versions >=1.4.
Cookiecutter template for Pysteps plugins. Cookiecutter is a command-line utility to creates python packages projects from templates, called "cookiecutters."
Note
Important: Currently, only importers and diagnostic postprocessors are supported as plugins.
When the plugin is installed, it advertises the new functions to other packages (in our case, pysteps) using the python entry points specification. These new functions are automatically discovered every time that the pysteps library is imported. The discovered functions are added as attributes to their specified module and registered to the module's interface without any user intervention. For example, in the case of an importer plugin, the importers would be added as attributes to the io.importers module and registered to the io.get_method interface. 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.
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-plugin
The above command will prompt the user to enter the following values used to generate a skeleton for the plugin package:
- full_name: Your full name.
- email: Your email address.
- plugin_type: The type of plugin you would like to create. Options: [1. importer, 2. diagnostics]
- project_name: The name of your new Pysteps plugin.
- project_slug: The namespace of your Python package. The name should be Python import friendly (no spaces, no hyphens, and no special characters).
- project_short_description: Short description of the plugin.
- plugin_name: Name of the module implementing the plugin.
- version: The starting version number for your project.
- open_source_license. Choose a license for your project. Options: [1. MIT License, 2. BSD license, 3. ISC license, 4. Apache Software License 2.0, 5. GNU General Public License v3, 6. Not open source]
The cookiecutter-pysteps-plugin template was adapted from the cookiecutter-pypackage template.