Skip to content

Commit 327d6da

Browse files
committed
Change references to postprocessor-diagnostic to diagnostic only
1 parent 63c1398 commit 327d6da

File tree

5 files changed

+29
-28
lines changed

5 files changed

+29
-28
lines changed

{{cookiecutter.project_name}}/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ License
1414
Documentation
1515
=============
1616

17-
Here write a short description of the plugin, indicating the importers or postprocessors that it provides.
17+
Here write a short description of the plugin, indicating the importers, diagnostics etc. that it provides.
1818

1919
Installation instructions
2020
=========================

{{cookiecutter.project_name}}/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
# An entry point is defined by three properties:
6969
# - The group that an entry point belongs indicate the kind of functionality that
7070
# provides. For the pysteps importers use the "pysteps.plugins.importers" group.
71-
# For the pysteps diagnostic postprocessors use the "pysteps.plugins.postprocessor" group.
71+
# For the pysteps diagnostics use the "pysteps.plugins.diagnostics" group.
7272
# - The unique name that is used to identify this entry point in the
7373
# "pysteps.plugins.importers" group.
7474
# - A reference to a Python object. For the pysteps importers, the object should

{{cookiecutter.project_name}}/tests/test_{{cookiecutter.project_slug}}.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ def test_plugins_discovery():
1818
for importer in new_importers:
1919
assert importer.replace("import_", "") in io_interface._importer_methods
2020

21-
elif plugin_type == "postprocessor":
22-
new_postprocessors = ["{{cookiecutter.plugin_name }}"]
23-
for postprocessor in new_postprocessors:
24-
postprocessor.replace("postprocessors_", "")
25-
if postprocessor.startswith("diagnostics"):
26-
assert postprocessor in pp_interface._diagnostics_methods
27-
elif postprocessor.startswith("ensemblestats"):
28-
assert postprocessor in pp_interface._ensemblestats_methods
29-
21+
elif plugin_type == "diagnostic":
22+
new_dagnostics = ["{{cookiecutter.plugin_name }}"]
23+
for diagnostic in new_diagnostics:
24+
assert diagnostic in pp_interface._diagnostics_methods
25+
26+
elif plugin_type == "ensemblestat":
27+
new_ensemblestats = ["{{cookiecutter.plugin_name }}"]
28+
for ensemblestat in new_ensemblestats:
29+
assert ensemblestat in pp_interface._ensemblestats_methods
3030

3131
def test_importers_with_files():
3232
"""Additionally, you can test that your plugin correctly reads the corresponding
Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,29 @@
88

99
# Import the needed libraries
1010

11-
### Uncomment the next lines if pyproj is needed for the postprocessor.
11+
### Uncomment the next lines if pyproj is needed
1212
# try:
1313
# import pyproj
1414
#
1515
# PYPROJ_IMPORTED = True
1616
# except ImportError:
1717
# PYPROJ_IMPORTED = False
1818

19-
# Function {{ cookiecutter.plugin_name }} to create postprocessing plugins.
19+
# Function {{ cookiecutter.plugin_name }} to create diagnostic plugins.
2020

21-
# IMPORTANT: The name of the postprocessor should follow the "postprocessor_postprocessorType_postprocessorName"
22-
# naming convention. The "postprocessor_" prefix to the postprocessor name is MANDATORY since it is
23-
# used by the pysteps interface. "postprocessorType" refers to the category of postprocessor e.g. diagnostics, ensemblestats, etc.
24-
# "postprocessorName" refers to a unique identifier name for the postprocessor e.g. prtype, meancalc, etc.
21+
# IMPORTANT: The name of the plugin should follow the "postprocessingType_postprocessingName"
22+
# naming convention. "postprocessingType" refers to the category of
23+
# postprocessing e.g. diagnostics, ensemblestats, etc. "postprocessingName"
24+
# refers to a unique identifier name for the postprocessing e.g. prtype,
25+
# meancalc, etc.
2526
#
26-
# Check the pysteps documentation for examples of postprocessor names that follow this
27+
# Check the pysteps documentation for examples of postprocessing names that follow this
2728
# convention:
2829
# https://pysteps.readthedocs.io/en/latest/pysteps_reference/io.html#available-diagnostics
2930
#
30-
# The function prototype for the postprocessor's declaration should have the following form:
31+
# The function prototype for the postprocessing's declaration should have the following form:
3132
#
32-
# def postprocessor_type_xyz(filename, **kwargs):
33+
# def postprocessingtype_xyz(filename, **kwargs):
3334
#
3435
#
3536
# Function arguments
@@ -38,7 +39,7 @@
3839
# The function arguments should have the following form:
3940
# (filename, keyword1="some_keyword", keyword2=10,...,keywordN="something", **kwargs)
4041
# The `filename` and `**kwargs` arguments are mandatory to comply with the pysteps
41-
# interface. To fine-control the behaviour of the postprocessor, additional keywords can be
42+
# interface. To fine-control the behaviour of the postprocessing, additional keywords can be
4243
# added to the function.
4344
# For example: keyword1="some_keyword", keyword2=10, ..., keywordN="something"
4445
# It is recommended to declare the keywords explicitly in the function to improve the
@@ -48,14 +49,14 @@
4849
# Return arguments
4950
# ~~~~~~~~~~~~~~~~
5051
#
51-
# The postprocessor can return whatever argument is needed.
52+
# The postprocessing can return whatever argument is needed.
5253
#
5354
#
5455

5556
def {{cookiecutter.plugin_name}}(filename, **kwargs):
5657
"""
57-
A detailed description of the postprocessor. A minimal documentation is
58-
strictly needed since the pysteps postprocessor interface expects docstrings.
58+
A detailed description of the postprocessing plugin. A minimal documentation is
59+
strictly needed since the pysteps postprocessing interface expects docstrings.
5960
6061
For example, the documentation may look like this:
6162
@@ -67,19 +68,19 @@ def {{cookiecutter.plugin_name}}(filename, **kwargs):
6768
Name of the file to be processed.
6869
6970
keyword1 : str
70-
Some keyword used to fine control the diagnostic postprocessor behaviour.
71+
Some keyword used to fine control the behaviour.
7172
7273
keyword2 : int
73-
Another keyword used to fine control the diagnostic postprocessor behaviour.
74+
Another keyword used to fine control the behaviour.
7475
7576
{extra_kwargs_doc}
7677
7778
Returns
7879
-------.
7980
"""
8081
####################################################################################
81-
# Add the code required to run the postprocessor here.
82+
# Add the code required to run the postprocessing here.
8283
file = open(filename, "w")
8384
file.write("hello world")
8485
file.close()
85-
return file
86+
return file

0 commit comments

Comments
 (0)