CSET 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
CSET/__init__.py ADDED
@@ -0,0 +1,65 @@
1
+ # Copyright 2022-2023 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ CSET: Convective Scale Evaluation Tool
17
+ """
18
+
19
+ import argparse
20
+ import logging
21
+ from pathlib import Path
22
+
23
+
24
+ def main():
25
+ """CLI entrypoint."""
26
+ parser = argparse.ArgumentParser(
27
+ prog="cset", description="Convective Scale Evaluation Tool."
28
+ )
29
+ parser.add_argument(
30
+ "--verbose",
31
+ "-v",
32
+ action="count",
33
+ default=0,
34
+ help="increase output verbosity, may be specified multiple times",
35
+ )
36
+ # https://docs.python.org/3/library/argparse.html#sub-commands
37
+ subparsers = parser.add_subparsers(title="subcommands", dest="subparser")
38
+
39
+ # Run operator chain
40
+ parser_operators = subparsers.add_parser(
41
+ "operators", help="run a chain of operators"
42
+ )
43
+ parser_operators.add_argument("input_file", type=Path, help="input file to read")
44
+ parser_operators.add_argument("output_file", type=Path, help="output file to write")
45
+ parser_operators.add_argument(
46
+ "recipe_file", type=Path, help="recipe file to execute"
47
+ )
48
+ parser_operators.set_defaults(func=_run_operators)
49
+ args = parser.parse_args()
50
+ # Logging verbosity
51
+ if args.verbose >= 2:
52
+ logging.basicConfig(level=logging.DEBUG)
53
+ elif args.verbose >= 1:
54
+ logging.basicConfig(level=logging.INFO)
55
+
56
+ if args.subparser:
57
+ args.func(args)
58
+ else:
59
+ parser.print_help()
60
+
61
+
62
+ def _run_operators(args):
63
+ from .operators import execute_recipe
64
+
65
+ execute_recipe(args.recipe_file, args.input_file, args.output_file)
CSET/__main__.py ADDED
@@ -0,0 +1,18 @@
1
+ # Copyright 2022-2023 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ import sys # pragma: no cover
16
+ from . import main # pragma: no cover
17
+
18
+ sys.exit(main()) # pragma: no cover
@@ -0,0 +1,25 @@
1
+ # Copyright 2022-2023 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ This module has an attribute for each recipe, holding the Path to that recipe.
17
+ """
18
+ try:
19
+ from importlib.resources import files
20
+ except ImportError:
21
+ # importlib has the files API from python 3.9
22
+ from importlib_resources import files
23
+ import CSET.operators.RECIPES as recipes
24
+
25
+ extract_instant_air_temp = files(recipes).joinpath("extract_instant_air_temp.toml")
@@ -0,0 +1,22 @@
1
+ # Copyright 2022-2023 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """This subpackage contains all of CSET's operators."""
16
+ from . import RECIPES, constraints, read, write, filters, plot, misc
17
+ from ._internal import execute_recipe
18
+
19
+ # Stop iris giving a warning whenever it loads something.
20
+ from iris import FUTURE
21
+
22
+ FUTURE.datum_support = True
@@ -0,0 +1,121 @@
1
+ # Copyright 2022-2023 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """Internal functions used to run operators."""
16
+
17
+ import logging
18
+ from pathlib import Path
19
+
20
+ try:
21
+ import tomllib
22
+ except ModuleNotFoundError:
23
+ # tomllib is in standard library from 3.11.
24
+ import tomli as tomllib
25
+
26
+ import CSET.operators
27
+
28
+
29
+ def get_operator(name: str):
30
+ """
31
+ Gets an operator by its name.
32
+
33
+ Parameters
34
+ ----------
35
+ name: str
36
+ The name of the desired operator.
37
+
38
+ Returns
39
+ -------
40
+ function
41
+ The named operator.
42
+
43
+ Raises
44
+ ------
45
+ ValueError
46
+ If name is not an operator.
47
+
48
+ Examples
49
+ --------
50
+ >>> CSET.operators.get_operator("read.read_cubes")
51
+ <function read_cubes at 0x7fcf9353c8b0>
52
+ """
53
+
54
+ try:
55
+ name_sections = name.split(".")
56
+ operator = CSET.operators
57
+ for section in name_sections:
58
+ operator = getattr(operator, section)
59
+ if callable(operator):
60
+ return operator
61
+ else:
62
+ raise AttributeError
63
+ except (AttributeError, TypeError):
64
+ raise ValueError(f"Unknown operator: {name}")
65
+
66
+
67
+ def execute_recipe(recipe_file: Path, input_file: Path, output_file: Path) -> None:
68
+ """Parses and executes a recipe file.
69
+
70
+ Parameters
71
+ ----------
72
+ recipe_file: Path
73
+ Pathlike to a configuration file indicating the operators that need
74
+ running.
75
+
76
+ input_file: Path
77
+ Pathlike to netCDF (or something else that iris read) file to be used as
78
+ input.
79
+
80
+ output_file: Path
81
+ Pathlike indicating desired location of output.
82
+
83
+ Raises
84
+ ------
85
+ FileNotFoundError
86
+ The recipe or input file cannot be found.
87
+
88
+ ValueError
89
+ The recipe file is not well formed.
90
+ """
91
+
92
+ def step_parser(step, step_io, output_file_path: Path) -> str:
93
+ if "input" in step:
94
+ if type(step["input"]) == dict:
95
+ logging.debug(f"Recursing into input: {step['input']}")
96
+ step_io = step_parser(step["input"], step_io, output_file_path)
97
+ else:
98
+ step_io = step["input"]
99
+ kwargs = {}
100
+ if "args" in step:
101
+ for key in step["args"].keys():
102
+ if type(step["args"][key]) == dict:
103
+ logging.debug(f"Recursing into args: {step['args']}")
104
+ kwargs[key] = step_parser(
105
+ step["args"][key], step_io, output_file_path
106
+ )
107
+ elif step["args"][key] == "MAGIC_OUTPUT_PATH":
108
+ kwargs[key] = output_file_path
109
+ else:
110
+ kwargs[key] = step["args"][key]
111
+ operator = get_operator(step["operator"])
112
+ logging.info(f"operator = {step['operator']}")
113
+ logging.debug(f"step_input = {step_io}")
114
+ logging.debug(f"args = {kwargs}")
115
+ return operator(step_io, **kwargs)
116
+
117
+ with open(recipe_file, "rb") as f:
118
+ recipe = tomllib.load(f)
119
+ step_io = input_file
120
+ for step in recipe["steps"]:
121
+ step_io = step_parser(step, step_io, output_file)
@@ -0,0 +1,148 @@
1
+ # Copyright 2022 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Operators to generate constraints to filter with.
17
+ """
18
+
19
+ import iris
20
+ import iris.cube
21
+ from datetime import datetime
22
+
23
+
24
+ def generate_stash_constraint(stash: str, **kwargs) -> iris.AttributeConstraint:
25
+ """
26
+ Operator that takes a stash string, and uses iris to generate a constraint
27
+ to be passed into the read operator to minimize the CubeList the read
28
+ operator loads and speed up loading.
29
+
30
+ Arguments
31
+ ---------
32
+ stash: str
33
+ stash code to build iris constraint, currently using "m01s03i236"
34
+
35
+ Returns
36
+ -------
37
+ stash_constraint: iris.AttributeConstraint
38
+ """
39
+
40
+ # At a later stage str list an option to combine constraints. Arguments
41
+ # could be a list of stash codes that combined build the constraint.
42
+ stash_constraint = iris.AttributeConstraint(STASH=stash)
43
+ return stash_constraint
44
+
45
+
46
+ def generate_var_constraint(varname: str, **kwargs) -> iris.Constraint:
47
+ """
48
+ Operator that takes a CF compliant variable name string, and uses iris to
49
+ generate a constraint to be passed into the read operator to minimize the
50
+ CubeList the read operator loads and speed up loading.
51
+
52
+ Arguments
53
+ ---------
54
+ varname: str
55
+ CF compliant name of variable. Needed later for LFRic.
56
+
57
+ Returns
58
+ -------
59
+ varname_constraint: iris.Constraint
60
+ """
61
+
62
+ varname_constraint = iris.Constraint(name=varname)
63
+ return varname_constraint
64
+
65
+
66
+ def generate_cell_methods_constraint(cell_methods: list, **kwargs) -> iris.Constraint:
67
+ """
68
+ Operator that takes a list of cell methods and generates a constraint from
69
+ that.
70
+
71
+ Arguments
72
+ ---------
73
+ cell_methods: list
74
+ cube.cell_methods for filtering
75
+
76
+ Returns
77
+ -------
78
+ cell_method_constraint: iris.Constraint
79
+ """
80
+
81
+ def check_cell_methods(cube: iris.cube.Cube):
82
+ if cube.cell_methods == tuple(cell_methods):
83
+ return True
84
+ else:
85
+ return False
86
+
87
+ cell_methods_constraint = iris.Constraint(cube_func=check_cell_methods)
88
+ return cell_methods_constraint
89
+
90
+
91
+ def generate_time_constraint(
92
+ time_start: str, time_end: str = None, **kwargs
93
+ ) -> iris.AttributeConstraint:
94
+ """
95
+ Operator that takes one or two ISO 8601 date strings, and returns a
96
+ constraint that selects values between those dates (inclusive).
97
+
98
+ Arguments
99
+ ---------
100
+ time_start: str | datetime.datetime
101
+ ISO date for lower bound
102
+
103
+ time_end: str | datetime.datetime
104
+ ISO date for upper bound. If omitted it defaults to the same as
105
+ time_start
106
+
107
+ Returns
108
+ -------
109
+ time_constraint: iris.Constraint
110
+ """
111
+ if type(time_start) == str:
112
+ time_start = datetime.fromisoformat(time_start)
113
+ if time_end is None:
114
+ time_end = time_start
115
+ elif type(time_end) == str:
116
+ time_end = datetime.fromisoformat(time_end)
117
+ time_constraint = iris.Constraint(time=lambda t: time_start <= t.point <= time_end)
118
+ return time_constraint
119
+
120
+
121
+ def combine_constraints(input_constraint: iris.Constraint, **kwargs) -> iris.Constraint:
122
+ """
123
+ Operator that combines multiple constraints into one.
124
+
125
+ Arguments
126
+ ---------
127
+ input_constraint: iris.Constraint
128
+ First constraint to combine.
129
+ additional_constraint_1: iris.Constraint
130
+ Second constraint to combine. This must be a named argument.
131
+ additional_constraint_2: iris.Constraint
132
+ There can be any number of additional constraint, they just need unique
133
+ names.
134
+
135
+ Returns
136
+ -------
137
+ combined_constraint: iris.Constraint
138
+
139
+ Raises
140
+ ------
141
+ TypeError
142
+ If the provided arguments are not constraints.
143
+ """
144
+
145
+ combined_constraint = input_constraint
146
+ for constraint in kwargs.values():
147
+ combined_constraint = combined_constraint & constraint
148
+ return combined_constraint
@@ -0,0 +1,55 @@
1
+ # Copyright 2022 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Operators to perform various kind of filtering.
17
+ """
18
+
19
+ import iris
20
+ import iris.cube
21
+
22
+
23
+ def filter_cubes(
24
+ cubelist: iris.cube.CubeList, constraint: iris.Constraint, **kwargs
25
+ ) -> iris.cube.Cube:
26
+ """
27
+ Filters a cubelist down to a single cube based on a constraint.
28
+
29
+ Arguments
30
+ ---------
31
+ cubelist: iris.cube.CubeList
32
+ Cubes to iterate over
33
+ constraint: iris.Constraint
34
+ Constraint to extract
35
+
36
+ Returns
37
+ -------
38
+ cube: iris.cube.Cube
39
+ Single variable
40
+
41
+ Raises
42
+ ------
43
+ ValueError
44
+ If the constraint doesn't produce a single cube.
45
+ """
46
+
47
+ filtered_cubes = cubelist.extract(constraint)
48
+
49
+ # Check filtered cubes is a CubeList containing one cube.
50
+ if len(filtered_cubes) == 1:
51
+ return filtered_cubes[0]
52
+ else:
53
+ raise ValueError(
54
+ f"Constraint doesn't produce single cube. {constraint}\n{filtered_cubes}"
55
+ )
CSET/operators/misc.py ADDED
@@ -0,0 +1,35 @@
1
+ # Copyright 2022 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Miscellaneous operators.
17
+ """
18
+
19
+
20
+ def noop(x, **kwargs):
21
+ """
22
+ Returns its input without doing anything to it. Useful for constructing
23
+ diagnostic chains.
24
+
25
+ Arguments
26
+ ---------
27
+ x: Any
28
+ Input to return.
29
+
30
+ Returns
31
+ -------
32
+ x: Any
33
+ The input that was given.
34
+ """
35
+ return x
CSET/operators/plot.py ADDED
@@ -0,0 +1,50 @@
1
+ # Copyright 2022 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Operators to produce various kinds of plots.
17
+ """
18
+
19
+ from pathlib import Path
20
+ import iris
21
+ import iris.cube
22
+ import iris.quickplot as qplt
23
+ import matplotlib.pyplot as plt
24
+
25
+
26
+ def spatial_contour_plot(cube: iris.cube.Cube, file_path: Path, **kwargs) -> Path:
27
+ """
28
+ Plots a spatial variable onto a map.
29
+
30
+ Parameters
31
+ ----------
32
+ cube: Cube
33
+ An iris cube of the data to plot. It should be 2 dimensional (lat and lon).
34
+ file_path: pathlike
35
+ The path of the plot to write.
36
+
37
+ Returns
38
+ -------
39
+ Path
40
+ The path of the resultant plot.
41
+
42
+ Raises
43
+ ------
44
+ ValueError
45
+ If the cube doesn't have the right dimensions.
46
+ """
47
+ qplt.contourf(cube)
48
+ file_path = Path(file_path).with_suffix(".svg")
49
+ plt.savefig(file_path)
50
+ return file_path
CSET/operators/read.py ADDED
@@ -0,0 +1,48 @@
1
+ # Copyright 2022 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Operators for reading various types of files from disk.
17
+ """
18
+
19
+ from pathlib import Path
20
+
21
+ import iris
22
+ import iris.cube
23
+
24
+
25
+ def read_cubes(
26
+ loadpath: Path, constraint: iris.Constraint = None, **kwargs
27
+ ) -> iris.cube.CubeList:
28
+ """
29
+ Read operator that takes a path string (can include wildcards), and uses
30
+ iris to load all the cubes matching stash and return a CubeList object.
31
+
32
+ Arguments
33
+ ---------
34
+ loadpath: pathlike
35
+ Path to where .pp/.nc files are located
36
+ constraint: iris.Constraint or iris.ConstraintCombination, optional
37
+ Constraints to filter by
38
+
39
+ Returns
40
+ -------
41
+ cubes: iris.cube.CubeList
42
+ Cubes extracted
43
+ """
44
+
45
+ if constraint:
46
+ return iris.load(loadpath, constraint)
47
+ else:
48
+ return iris.load(loadpath)
@@ -0,0 +1,50 @@
1
+ # Copyright 2022 Met Office and contributors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Operators for writing various types of files to disk.
17
+ """
18
+
19
+ from pathlib import Path
20
+ from typing import Union
21
+
22
+ import iris
23
+ import iris.cube
24
+
25
+
26
+ def write_cube_to_nc(
27
+ cube: Union[iris.cube.Cube, iris.cube.CubeList], file_path: Path, **kwargs
28
+ ) -> str:
29
+ """
30
+ A write operator that sits after the read operator. This operator expects
31
+ an iris cube object that will then be passed to MET for further processing.
32
+
33
+ Arguments
34
+ ---------
35
+ cube: iris.cube.Cube | iris.cube.CubeList
36
+ Data to save
37
+ file_path: Path
38
+ Path to save the cubes too
39
+
40
+ Returns
41
+ -------
42
+ file_path: Path
43
+ Filepath to saved .nc
44
+ """
45
+
46
+ # Ensure that output_file_path is a Path with a .nc suffix
47
+ file_path = Path(file_path).with_suffix(".nc")
48
+ # Save the file as nc compliant (iris should handle this)
49
+ iris.save(cube, file_path)
50
+ return file_path
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,54 @@
1
+ Metadata-Version: 2.1
2
+ Name: CSET
3
+ Version: 0.1.0
4
+ Summary: Convective Scale Evaluation Tool for evaluation and investigation of regional models.
5
+ Author: Met Office, NIWA
6
+ License: Apache-2.0
7
+ Project-URL: Documentation, https://metoffice.github.io/CSET
8
+ Project-URL: Source, https://github.com/MetOffice/CSET
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Topic :: Scientific/Engineering :: GIS
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENCE
14
+ Requires-Dist: numpy
15
+ Requires-Dist: scitools-iris
16
+ Requires-Dist: tomli (>=1.1.0) ; python_version < "3.11"
17
+ Requires-Dist: importlib-resources (>=3.0.0) ; python_version < "3.9"
18
+
19
+ # CSET
20
+
21
+ CSET is a tool to aid in evaluating regional model configurations. It aims to
22
+ replace the collection of bespoke scripts littering people’s home directories,
23
+ reducing effort wasted on duplicating already existing code. This centralisation
24
+ of diagnostics should also make evaluations more consistent and comparable.
25
+ Development takes place in the CSET repository on GitHub.
26
+
27
+ Please read [the documentation](https://metoffice.github.io/CSET) to learn more
28
+ about CSET, and how to use it.
29
+
30
+ ## Contributing
31
+
32
+ Contributions are readily welcomed! To get started with developing CSET visit
33
+ the [Working
34
+ Practices](https://metoffice.github.io/CSET/working-practices/#getting-started)
35
+ section of the documentation.
36
+
37
+ In addition to reading the working practices, the key
38
+ recommendation is early communication. Open an [issue on
39
+ Github](https://github.com/MetOffice/CSET/issues) with your proposed change or
40
+ addition in the design phase, and then others can provide guidance early.
41
+
42
+ ## Licence
43
+
44
+ Copyright © 2022-2023 Met Office and contributors.
45
+
46
+ Licensed under the [Apache License, Version 2.0](LICENCE) (the "License"); You
47
+ may obtain a copy of the License at
48
+
49
+ <http://www.apache.org/licenses/LICENSE-2.0>
50
+
51
+ Unless required by applicable law or agreed to in writing, software distributed
52
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
53
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
54
+ specific language governing permissions and limitations under the License.
@@ -0,0 +1,17 @@
1
+ CSET/__init__.py,sha256=XLNsjSMPIqEqlc_7lt6v0mvv3b34KkK9yhYPmtToeRI,2085
2
+ CSET/__main__.py,sha256=2aMZAUu-NqfVvIdcErhrwurDJdgV3l93oIJYptZuFDM,706
3
+ CSET/operators/__init__.py,sha256=p6TkLC0SxZEhMs5L8t3htyCaox2ra9ZHWVgIHeY060c,873
4
+ CSET/operators/_internal.py,sha256=aJ_F35f8IaIL5qGOOf-YvKsQQs2C3JFtRvbl1umnt8k,3600
5
+ CSET/operators/constraints.py,sha256=vOxTZgee7F9n57f_UeTYLc8g5k_t4tzBGo5rxySBYgQ,4397
6
+ CSET/operators/filters.py,sha256=C4Z2Fc7ta5SrlKxKOyU_4xchP0SEj11nz3lowZRN_gE,1511
7
+ CSET/operators/misc.py,sha256=4p7eYLmhcc08_cCSudYe8N7CcftYwiQxvdvVD-Pk8wE,914
8
+ CSET/operators/plot.py,sha256=qCqWYZWb-1ktk4owGRma-Ntcz_OTOnrSEzgO5hr5cbI,1389
9
+ CSET/operators/read.py,sha256=R0XgosUVTUbwDoUk8rUYWW6zp5_FpqH4JpDPHOWpxqM,1386
10
+ CSET/operators/write.py,sha256=VFHkTLeXRW_v6zc_9gSmxTznbxwScthMTf1KqXQJ4yc,1478
11
+ CSET/operators/RECIPES/__init__.py,sha256=hbATZrvwMhcqEpX9WwY5Gr25iABGMooBdJXmUwAydzs,970
12
+ CSET-0.1.0.dist-info/LICENCE,sha256=IO92bVWJFYtEqzFiGlOrFfIX6UCTGFoTB_FsmMA38LM,10996
13
+ CSET-0.1.0.dist-info/METADATA,sha256=GKB-VpIr0Ezq2pdCWFp-Y5y5uhkUxADxPJX9847L58A,2193
14
+ CSET-0.1.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
15
+ CSET-0.1.0.dist-info/entry_points.txt,sha256=q_FkJVV0yibhVsfvUJCqZ10TX1T4D1rObsjuUiiEXIk,35
16
+ CSET-0.1.0.dist-info/top_level.txt,sha256=v7cPH10heGhYtskIt4nuhWohbLALaJcMACm04oAETDA,5
17
+ CSET-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.40.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ cset = CSET:main
@@ -0,0 +1 @@
1
+ CSET