1
1
.. _create_your_own_plugin :
2
2
3
3
===============================
4
- Create your own postprocessor plugin
4
+ Create your own diagnostic postprocessor plugin
5
5
===============================
6
6
7
- Since version 1.11, pysteps allows the users to add new postprocessors by installing external
7
+ Since version 1.11, pysteps allows the users to add new diagnostic postprocessors by installing external
8
8
packages, called plugins, without modifying the pysteps installation. These plugins need
9
9
to follow a particular structure (described next) to allow pysteps to discover and
10
- integrate the new postprocessors to the pysteps interface without any user intervention.
10
+ integrate the new diagnostic postprocessors to the pysteps interface without any user intervention.
11
11
For a short description of how the plugins work, see :ref: `how_plugins_work `.
12
12
There are two ways of creating your plugin. The first one involves building the plugin
13
13
from scratch. An easier alternative is using a Cookiecutter template that easily builds
14
14
the skeleton for the new importer plugin.
15
15
16
- There are two ways of creating a plugin. The first one is building the postprocessor plugin
16
+ There are two ways of creating a plugin. The first one is building the diagnostic postprocessor plugin
17
17
from scratch. However, an easier alternative is using this `Cookiecutter `_ template
18
- to create the skeleton for the new postprocessor plugin, and then customize it.
18
+ to create the skeleton for the new diagnostic postprocessor plugin, and then customize it.
19
19
However, this can be a daunting task if you are creating your first plugin.
20
20
Hence, before customizing the cookiecutter template, let's review the main components of
21
- the plugin architecture by describing how to build a postprocessor plugin from scratch.
21
+ the plugin architecture by describing how to build a diagnostic postprocessor plugin from scratch.
22
22
23
23
After you are familiar with the plugin fundamentals, you can build your plugin from the
24
24
cookiecutter template. For a detailed description of the template, see
@@ -29,22 +29,22 @@ cookiecutter template. For a detailed description of the template, see
29
29
Minimal plugin project
30
30
----------------------
31
31
32
- Let's suppose that we want to add a new postprocessor to pysteps. The name of the
33
- postprocessor will be denoted as xxx.
32
+ Let's suppose that we want to add a new diagnostic postprocessor to pysteps. The name of the
33
+ diagnostic postprocessor will be denoted as xxx.
34
34
35
35
Without further ado, let's create a python package (a.k.a. the plugin) implementing the
36
- postprocessor. For simplicity, we will only include the elements that are strictly
36
+ diagnostic postprocessor. For simplicity, we will only include the elements that are strictly
37
37
needed for the plugin to be installed and to work correctly.
38
38
39
- The minimal python package to implement an postprocessor plugin has the following
39
+ The minimal python package to implement a diagnostic postprocessor plugin has the following
40
40
structure:
41
41
42
42
::
43
43
44
- pysteps-postprocessor -xxx (project name)
45
- ├── pysteps_postprocessor_xxx (package name)
46
- │ ├── postprocessor_xxx .py (importer module)
47
- │ └── __init__.py (Initialize the pysteps_importer_abc package)
44
+ pysteps-diagnostic -xxx (project name)
45
+ ├── pysteps_diagnostic_xxx (package name)
46
+ │ ├── diagnostic_xxx .py (diagnostic module)
47
+ │ └── __init__.py (Initialize the pysteps_diagnostic_xxx package)
48
48
├── setup.py (Build and installation script)
49
49
└── MANIFEST.in (manifest template)
50
50
@@ -53,31 +53,31 @@ Project name
53
53
54
54
::
55
55
56
- pysteps-postprocessor -xxx (project name)
56
+ pysteps-diagnostic -xxx (project name)
57
57
58
58
For the project name, our example used the following convention:
59
- **pysteps-postprocessor-<postprocessor short name> **.
59
+ **pysteps-diagnostic-<diagnostic short name> **.
60
60
Note that this convention is not strictly needed, and any name can be used.
61
61
62
62
Package name
63
63
~~~~~~~~~~~~
64
64
65
65
::
66
66
67
- pysteps-postprocessor -xxx
68
- └── pysteps_postprocessor_xxx (package name)
67
+ pysteps-diagnostic -xxx
68
+ └── pysteps_diagnostic_xxx (package name)
69
69
70
- This is the name of our package containing the new postprocessor for pysteps.
70
+ This is the name of our package containing the new diagnostic postprocessor for pysteps.
71
71
The package name should not contain spaces, hyphens, or uppercase letters.
72
- For our example, the package name is **pysteps_postprocessor_xxx **.
72
+ For our example, the package name is **pysteps_diagnostic_xxx **.
73
73
74
74
\_ _init__.py
75
75
~~~~~~~~~~~~
76
76
77
77
::
78
78
79
- pysteps-postprocessor -xxx
80
- ├── pysteps_postprocessor_xxx
79
+ pysteps-diagnostic -xxx
80
+ ├── pysteps_diagnostic_xxx
81
81
└───── __init__.py
82
82
83
83
The __init__.py files are required to inform python that a given directory contains a
@@ -89,15 +89,15 @@ Importer module
89
89
90
90
::
91
91
92
- pysteps-postprocessor -xxx
93
- ├── pysteps_postprocessor_xxx
94
- └───── postprocessor_xxx .py (postprocessor module)
92
+ pysteps-diagnostic -xxx
93
+ ├── pysteps_diagnostic_xxx
94
+ └───── diagnostic_xxx .py (diagnostic module)
95
95
96
- Inside the package folder (*pysteps_postprocessor_xxx *), we place the python module
97
- (or modules) containing the actual implementation of our new postprocessor.
98
- Below, there is an example of an postprocessor module that implements the skeleton of a postprocessor:
96
+ Inside the package folder (*pysteps_diagnostic_xxx *), we place the python module
97
+ (or modules) containing the actual implementation of our new diagnostic postprocessor.
98
+ Below, there is an example of a diagnostic postprocessor module that implements the skeleton of a diagnostic postprocessor:
99
99
100
- .. literalinclude :: postprocessor_module_example .py
100
+ .. literalinclude :: diagnostic_module_example .py
101
101
:language: python
102
102
103
103
@@ -106,7 +106,7 @@ setup.py
106
106
107
107
::
108
108
109
- pysteps-postprocessor -xxx (project name)
109
+ pysteps-diagnostic -xxx (project name)
110
110
└── setup.py (Build and installation script)
111
111
112
112
The `setup.py ` file contains all the definitions for building, distributing, and
0 commit comments