Skip to content

Commit d90ca83

Browse files
authored
Merge pull request #1 from pySTEPS/cookiecutter_testing
Name changed from postprocessors to diagnostics
2 parents 708a3ba + 03cdeaa commit d90ca83

17 files changed

+345
-131
lines changed

.github/workflows/run_tests.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
19-
python-version: [ "3.6", "3.8" ]
18+
os: [ "ubuntu-latest", "windows-latest" ]
19+
python-version: [ "3.11" ]
2020
max-parallel: 6
2121

2222
steps:
@@ -30,26 +30,26 @@ jobs:
3030
python -m pip install --upgrade pip
3131
pip install -r requirements_dev.txt
3232
33-
- name: Install pysteps on MacOS
34-
if: matrix.os == 'macos-latest'
35-
working-directory: ${{github.workspace}}
36-
env:
37-
CC: gcc-9
38-
CXX: g++-9
39-
CXX1X: g++-9
40-
HOMEBREW_NO_INSTALL_CLEANUP: 1
41-
run: |
42-
brew update-reset
43-
brew update
44-
brew install gcc@9
45-
gcc-9 --version
46-
pip install git+https://github.com/pySTEPS/pysteps@importer_plugins_support
47-
python -c "import pysteps"
33+
# - name: Install pysteps on MacOS
34+
# if: matrix.os == 'macos-latest'
35+
# working-directory: ${{github.workspace}}
36+
# env:
37+
# CC: gcc-9
38+
# CXX: g++-9
39+
# CXX1X: g++-9
40+
# HOMEBREW_NO_INSTALL_CLEANUP: 1
41+
# run: |
42+
# brew update-reset
43+
# brew update
44+
# brew install gcc@9
45+
# gcc-9 --version
46+
# pip install git+https://github.com/pySTEPS/pysteps
47+
# python -c "import pysteps"
4848

4949
- name: Install pysteps on Windows and Linux
5050
if: matrix.os != 'macos-latest'
5151
run: |
52-
pip install git+https://github.com/pySTEPS/pysteps@importer_plugins_support
52+
pip install git+https://github.com/pySTEPS/pysteps
5353
python -c "import pysteps"
5454
5555
- name: Run tests

LICENSE

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,60 @@
1-
Insert license information here
1+
------------------------------------------------------------------------------------------
2+
License for cookiecutter-pysteps-plugin
3+
4+
Copyright (c) 2020 Pysteps Developers
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of Audrey Roy Greenfeld nor the names of its contributors
16+
may be used to endorse or promote products derived from this software
17+
without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
31+
------------------------------------------------------------------------------------------
32+
Cookiecutter-pypackage license
33+
34+
Copyright (c) 2020 Audrey Roy Greenfeld and individual contributors.
35+
36+
All rights reserved.
37+
38+
Redistribution and use in source and binary forms, with or without modification,
39+
are permitted provided that the following conditions are met:
40+
41+
* Redistributions of source code must retain the above copyright notice,
42+
this list of conditions and the following disclaimer.
43+
* Redistributions in binary form must reproduce the above copyright notice,
44+
this list of conditions and the following disclaimer in the documentation
45+
and/or other materials provided with the distribution.
46+
* Neither the name of Audrey Roy Greenfeld nor the names of its contributors
47+
may be used to endorse or promote products derived from this software
48+
without specific prior written permission.
49+
50+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
51+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
52+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
53+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
54+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
55+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
56+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
57+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
58+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
59+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
60+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.. IMPORTANT::
22
The plugins support in pysteps is only available for versions >=1.4.
33

4-
Cookiecutter Pysteps-postprocessing-plugin
4+
Cookiecutter Pysteps-diagnostics-plugin
55
===========================
66

77
.. README_BEGIN_TAG
88
9-
Cookiecutter template for Pysteps postprocessing plugins.
9+
Cookiecutter template for Pysteps diagnostic postprocessing plugins.
1010
Cookiecutter_ is a command-line utility to creates python packages projects from
1111
templates, called "cookiecutters."
1212

@@ -17,10 +17,10 @@ templates, called "cookiecutters."
1717
How do the plugins work?
1818
========================
1919

20-
When the plugin is installed, it advertises the new postprocessors to other packages
20+
When the plugin is installed, it advertises the new diagnostic postprocessors to other packages
2121
(in our case, pysteps) using the python `entry points specification`_.
22-
These new postprocessors are automatically discovered every time that the pysteps library is
23-
imported. The discovered postprocessors are added as attributes to the postprocessing.processors module
22+
These new diagnostic postprocessors are automatically discovered every time that the pysteps library is
23+
imported. The discovered diagnostic postprocessors are added as attributes to the postprocessing.diagnostics module
2424
and registered to the postprocessing.get_method interface without any user intervention.
2525
In addition, since the plugins' installation does not modify the actual pysteps
2626
installation (i.e., the pysteps sources), the pysteps library can be updated without
@@ -37,7 +37,7 @@ Install the latest Cookiecutter::
3737

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

40-
cookiecutter https://github.com/pysteps/cookiecutter-pysteps-postprocessing-plugin
40+
cookiecutter https://github.com/pysteps/cookiecutter-pysteps-diagnostics-plugin
4141

4242
The above command will prompt the user to enter the following values used to generate
4343
a skeleton for the plugin package:
@@ -49,7 +49,7 @@ a skeleton for the plugin package:
4949
The name should be Python import friendly (no spaces, no hyphens, and no
5050
special characters).
5151
- **project_short_description**: Short description of the plugin.
52-
- **postprocessor_name**: Name of the module implementing the postprocessors.
52+
- **diagnostic_name**: Name of the module implementing the diagnostic postprocessors.
5353
- **version**: The starting version number for your project.
5454
- **open_source_license**. Choose a license for your project.
5555
Options: [1. MIT License, 2. BSD license, 3. ISC license, 4. Apache Software License

cookiecutter.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"full_name": "Your Name",
33
"email": "your@email.com",
4-
"project_name": "pysteps-postprocessor-xxx",
4+
"project_name": "pysteps-diagnostic-xxx",
55
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
6-
"project_short_description": "Pysteps plugin adding XXX postprocessing functionality.",
7-
"postprocessor_name": "postprocessor_xxx",
6+
"project_short_description": "Pysteps plugin adding XXX diagnostic postprocessing functionality.",
7+
"diagnostic_name": "diagnostic_xxx",
88
"version": "0.1.0",
99
"open_source_license": ["MIT license", "BSD license", "ISC license", "GNU General Public License v3", "Apache Software License 2.0", "Not open source"]
1010
}

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
master_doc = 'index'
2121

2222
# General information about the project.
23-
project = 'cookiecutter-pysteps-postprocessing-plugin'
23+
project = 'cookiecutter-pysteps-diagnostics-plugin'
2424
copyright = '2024, Pysteps developers'
2525
author = 'Pysteps developers'
2626

docs/create_your_own_plugin.rst

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
.. _create_your_own_plugin:
22

33
===============================
4-
Create your own postprocessor plugin
4+
Create your own diagnostic postprocessor plugin
55
===============================
66

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
88
packages, called plugins, without modifying the pysteps installation. These plugins need
99
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.
1111
For a short description of how the plugins work, see :ref:`how_plugins_work`.
1212
There are two ways of creating your plugin. The first one involves building the plugin
1313
from scratch. An easier alternative is using a Cookiecutter template that easily builds
1414
the skeleton for the new importer plugin.
1515

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
1717
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.
1919
However, this can be a daunting task if you are creating your first plugin.
2020
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.
2222

2323
After you are familiar with the plugin fundamentals, you can build your plugin from the
2424
cookiecutter template. For a detailed description of the template, see
@@ -29,22 +29,22 @@ cookiecutter template. For a detailed description of the template, see
2929
Minimal plugin project
3030
----------------------
3131

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.
3434

3535
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
3737
needed for the plugin to be installed and to work correctly.
3838

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
4040
structure:
4141

4242
::
4343

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)
4848
├── setup.py (Build and installation script)
4949
└── MANIFEST.in (manifest template)
5050

@@ -53,31 +53,31 @@ Project name
5353

5454
::
5555

56-
pysteps-postprocessor-xxx (project name)
56+
pysteps-diagnostic-xxx (project name)
5757

5858
For the project name, our example used the following convention:
59-
**pysteps-postprocessor-<postprocessor short name>**.
59+
**pysteps-diagnostic-<diagnostic short name>**.
6060
Note that this convention is not strictly needed, and any name can be used.
6161

6262
Package name
6363
~~~~~~~~~~~~
6464

6565
::
6666

67-
pysteps-postprocessor-xxx
68-
└── pysteps_postprocessor_xxx (package name)
67+
pysteps-diagnostic-xxx
68+
└── pysteps_diagnostic_xxx (package name)
6969

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.
7171
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**.
7373

7474
\__init__.py
7575
~~~~~~~~~~~~
7676

7777
::
7878

79-
pysteps-postprocessor-xxx
80-
├── pysteps_postprocessor_xxx
79+
pysteps-diagnostic-xxx
80+
├── pysteps_diagnostic_xxx
8181
└───── __init__.py
8282

8383
The __init__.py files are required to inform python that a given directory contains a
@@ -89,15 +89,15 @@ Importer module
8989

9090
::
9191

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)
9595

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:
9999

100-
.. literalinclude:: postprocessor_module_example.py
100+
.. literalinclude:: diagnostic_module_example.py
101101
:language: python
102102

103103

@@ -106,7 +106,7 @@ setup.py
106106

107107
::
108108

109-
pysteps-postprocessor-xxx (project name)
109+
pysteps-diagnostic-xxx (project name)
110110
└── setup.py (Build and installation script)
111111

112112
The `setup.py` file contains all the definitions for building, distributing, and

docs/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
.. _index:
22

33
======================================================
4-
Welcome to cookiecutter-pysteps-postprocessing-plugin's documentation
4+
Welcome to cookiecutter-pysteps-diagnostics-plugin's documentation
55
======================================================
66

77
.. include:: ../README.rst
88
:start-after: README_BEGIN_TAG
99
:end-before: README_END_TAG
1010

1111

12-
Create your own postprocessor plugin
12+
Create your own diagnostic postprocessor plugin
1313
===============================
1414

1515
The previous section showed us how to quickly generate a template for our plugin.
1616
The next step is to build your plugin, using the previous skeleton as an starting point.
1717
However, this can be a daunting task if you are creating your first plugin.
1818
To provide a easy-to-follow introduction to the plugin architecture, in the
1919
:ref:`create_your_own_plugin` section we present a step-by-step guide creating,
20-
from scratch, a minimal working example of a postprocessors plugin.
20+
from scratch, a minimal working example of a diagnostic postprocessors plugin.
2121
This tutorial explains in detail all the elements needed for the plugin to work correctly.
2222

2323
.. toctree::

0 commit comments

Comments
 (0)