6
6
in this module and other relevant information.
7
7
"""
8
8
9
- def {{cookiecutter .postprocessor_name }}_xxx (** kwargs ):
9
+ # Function {{ cookiecutter.postprocessor_name }}_xxx to create postprocess plugins named xxx.
10
+
11
+ # IMPORTANT: The name of the postprocessor should follow the "postprocessor_name"
12
+ # naming convention. The "postprocessor_" prefix to the postprocessor name is MANDATORY since it is
13
+ # used by the pysteps interface.
14
+ #
15
+ # Check the pysteps documentation for examples of postprocessors names that follow this
16
+ # convention:
17
+ # https://pysteps.readthedocs.io/en/latest/pysteps_reference/io.html#available-postprocessors
18
+ #
19
+ # The function prototype for the postprocessor's declaration should have the following form:
20
+ #
21
+ # def postprocess_xxx(filename, keyword1="some_keyword", keyword2=10, **kwargs):
22
+ #
23
+ #
24
+ # Function arguments
25
+ # ~~~~~~~~~~~~~~~~~~
26
+ #
27
+ # The function arguments should have the following form:
28
+ # (filename, keyword1="some_keyword", keyword2=10,...,keywordN="something", **kwargs)
29
+ # The `filename` and `**kwargs` arguments are mandatory to comply with the pysteps
30
+ # interface. To fine-control the behavior of the postprocessor, additional keywords can be
31
+ # added to the function.
32
+ # For example: keyword1="some_keyword", keyword2=10, ..., keywordN="something"
33
+ # It is recommended to declare the keywords explicitly in the function to improve the
34
+ # readability.
35
+ #
36
+ #
37
+ # Return arguments
38
+ # ~~~~~~~~~~~~~~~~
39
+ #
40
+ # The postprocessor should always return the following fields:
41
+ #
42
+ #
43
+
44
+ def {{cookiecutter .postprocessor_name }}_xxx (filename , ** kwargs ):
10
45
"""
11
46
A detailed description of the postprocessor. A minimal documentation is
12
47
strictly needed since the pysteps postprocessors interface expect docstrings.
@@ -17,15 +52,32 @@ def {{cookiecutter.postprocessor_name }}_xxx(**kwargs):
17
52
Grib format.
18
53
19
54
Parameters
20
- ----------
21
- parameter1: str
22
- description
23
-
55
+ ----------
56
+ filename : str
57
+ Name of the file to be processed.
58
+
59
+ keyword1 : str
60
+ Some keyword used to fine control the postprocessor behavior.
61
+
62
+ keyword2 : int
63
+ Another keyword used to fine control the postprocessor behavior.
64
+
65
+ {extra_kwargs_doc}
66
+
67
+ ####################################################################################
68
+ # The {extra_kwargs_doc} above is needed to add default keywords added to this #
69
+ # postprocessor by the pysteps.decorator.postprocess_postprocess decorator. #
70
+ # IMPORTANT: Remove these box in the final version of this function #
71
+ ####################################################################################
24
72
Returns
25
73
-------
26
- output: array
27
- description
74
+ filename: file
75
+ The file having been processed.
28
76
"""
77
+ ####################################################################################
78
+ # Add the code required to run the postprocessor here.
79
+ file = open (filename , "w" )
80
+ file .write ("hello world" )
81
+ file .close ()
82
+ return file
29
83
30
- output = "hello world"
31
- return output
0 commit comments