vortex-nwp 2.0.0b1__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.
- vortex/__init__.py +135 -0
- vortex/algo/__init__.py +12 -0
- vortex/algo/components.py +2136 -0
- vortex/algo/mpitools.py +1648 -0
- vortex/algo/mpitools_templates/envelope_wrapper_default.tpl +27 -0
- vortex/algo/mpitools_templates/envelope_wrapper_mpiauto.tpl +29 -0
- vortex/algo/mpitools_templates/wrapstd_wrapper_default.tpl +18 -0
- vortex/algo/serversynctools.py +170 -0
- vortex/config.py +115 -0
- vortex/data/__init__.py +13 -0
- vortex/data/abstractstores.py +1572 -0
- vortex/data/containers.py +780 -0
- vortex/data/contents.py +596 -0
- vortex/data/executables.py +284 -0
- vortex/data/flow.py +113 -0
- vortex/data/geometries.ini +2689 -0
- vortex/data/geometries.py +703 -0
- vortex/data/handlers.py +1021 -0
- vortex/data/outflow.py +67 -0
- vortex/data/providers.py +465 -0
- vortex/data/resources.py +201 -0
- vortex/data/stores.py +1271 -0
- vortex/gloves.py +282 -0
- vortex/layout/__init__.py +27 -0
- vortex/layout/appconf.py +109 -0
- vortex/layout/contexts.py +511 -0
- vortex/layout/dataflow.py +1069 -0
- vortex/layout/jobs.py +1276 -0
- vortex/layout/monitor.py +833 -0
- vortex/layout/nodes.py +1424 -0
- vortex/layout/subjobs.py +464 -0
- vortex/nwp/__init__.py +11 -0
- vortex/nwp/algo/__init__.py +12 -0
- vortex/nwp/algo/assim.py +483 -0
- vortex/nwp/algo/clim.py +920 -0
- vortex/nwp/algo/coupling.py +609 -0
- vortex/nwp/algo/eda.py +632 -0
- vortex/nwp/algo/eps.py +613 -0
- vortex/nwp/algo/forecasts.py +745 -0
- vortex/nwp/algo/fpserver.py +927 -0
- vortex/nwp/algo/ifsnaming.py +403 -0
- vortex/nwp/algo/ifsroot.py +311 -0
- vortex/nwp/algo/monitoring.py +202 -0
- vortex/nwp/algo/mpitools.py +554 -0
- vortex/nwp/algo/odbtools.py +974 -0
- vortex/nwp/algo/oopsroot.py +735 -0
- vortex/nwp/algo/oopstests.py +186 -0
- vortex/nwp/algo/request.py +579 -0
- vortex/nwp/algo/stdpost.py +1285 -0
- vortex/nwp/data/__init__.py +12 -0
- vortex/nwp/data/assim.py +392 -0
- vortex/nwp/data/boundaries.py +261 -0
- vortex/nwp/data/climfiles.py +539 -0
- vortex/nwp/data/configfiles.py +149 -0
- vortex/nwp/data/consts.py +929 -0
- vortex/nwp/data/ctpini.py +133 -0
- vortex/nwp/data/diagnostics.py +181 -0
- vortex/nwp/data/eda.py +148 -0
- vortex/nwp/data/eps.py +383 -0
- vortex/nwp/data/executables.py +1039 -0
- vortex/nwp/data/fields.py +96 -0
- vortex/nwp/data/gridfiles.py +308 -0
- vortex/nwp/data/logs.py +551 -0
- vortex/nwp/data/modelstates.py +334 -0
- vortex/nwp/data/monitoring.py +220 -0
- vortex/nwp/data/namelists.py +644 -0
- vortex/nwp/data/obs.py +748 -0
- vortex/nwp/data/oopsexec.py +72 -0
- vortex/nwp/data/providers.py +182 -0
- vortex/nwp/data/query.py +217 -0
- vortex/nwp/data/stores.py +147 -0
- vortex/nwp/data/surfex.py +338 -0
- vortex/nwp/syntax/__init__.py +9 -0
- vortex/nwp/syntax/stdattrs.py +375 -0
- vortex/nwp/tools/__init__.py +10 -0
- vortex/nwp/tools/addons.py +35 -0
- vortex/nwp/tools/agt.py +55 -0
- vortex/nwp/tools/bdap.py +48 -0
- vortex/nwp/tools/bdcp.py +38 -0
- vortex/nwp/tools/bdm.py +21 -0
- vortex/nwp/tools/bdmp.py +49 -0
- vortex/nwp/tools/conftools.py +1311 -0
- vortex/nwp/tools/drhook.py +62 -0
- vortex/nwp/tools/grib.py +268 -0
- vortex/nwp/tools/gribdiff.py +99 -0
- vortex/nwp/tools/ifstools.py +163 -0
- vortex/nwp/tools/igastuff.py +249 -0
- vortex/nwp/tools/mars.py +56 -0
- vortex/nwp/tools/odb.py +548 -0
- vortex/nwp/tools/partitioning.py +234 -0
- vortex/nwp/tools/satrad.py +56 -0
- vortex/nwp/util/__init__.py +6 -0
- vortex/nwp/util/async.py +184 -0
- vortex/nwp/util/beacon.py +40 -0
- vortex/nwp/util/diffpygram.py +359 -0
- vortex/nwp/util/ens.py +198 -0
- vortex/nwp/util/hooks.py +128 -0
- vortex/nwp/util/taskdeco.py +81 -0
- vortex/nwp/util/usepygram.py +591 -0
- vortex/nwp/util/usetnt.py +87 -0
- vortex/proxy.py +6 -0
- vortex/sessions.py +341 -0
- vortex/syntax/__init__.py +9 -0
- vortex/syntax/stdattrs.py +628 -0
- vortex/syntax/stddeco.py +176 -0
- vortex/toolbox.py +982 -0
- vortex/tools/__init__.py +11 -0
- vortex/tools/actions.py +457 -0
- vortex/tools/addons.py +297 -0
- vortex/tools/arm.py +76 -0
- vortex/tools/compression.py +322 -0
- vortex/tools/date.py +20 -0
- vortex/tools/ddhpack.py +10 -0
- vortex/tools/delayedactions.py +672 -0
- vortex/tools/env.py +513 -0
- vortex/tools/folder.py +663 -0
- vortex/tools/grib.py +559 -0
- vortex/tools/lfi.py +746 -0
- vortex/tools/listings.py +354 -0
- vortex/tools/names.py +575 -0
- vortex/tools/net.py +1790 -0
- vortex/tools/odb.py +10 -0
- vortex/tools/parallelism.py +336 -0
- vortex/tools/prestaging.py +186 -0
- vortex/tools/rawfiles.py +10 -0
- vortex/tools/schedulers.py +413 -0
- vortex/tools/services.py +871 -0
- vortex/tools/storage.py +1061 -0
- vortex/tools/surfex.py +61 -0
- vortex/tools/systems.py +3396 -0
- vortex/tools/targets.py +384 -0
- vortex/util/__init__.py +9 -0
- vortex/util/config.py +1071 -0
- vortex/util/empty.py +24 -0
- vortex/util/helpers.py +184 -0
- vortex/util/introspection.py +63 -0
- vortex/util/iosponge.py +76 -0
- vortex/util/roles.py +51 -0
- vortex/util/storefunctions.py +103 -0
- vortex/util/structs.py +26 -0
- vortex/util/worker.py +150 -0
- vortex_nwp-2.0.0b1.dist-info/LICENSE +517 -0
- vortex_nwp-2.0.0b1.dist-info/METADATA +50 -0
- vortex_nwp-2.0.0b1.dist-info/RECORD +146 -0
- vortex_nwp-2.0.0b1.dist-info/WHEEL +5 -0
- vortex_nwp-2.0.0b1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AlgoComponents for OOPS elementary tests.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
import footprints
|
|
8
|
+
|
|
9
|
+
from vortex.algo.components import AlgoComponentDecoMixin, algo_component_deco_mixin_autodoc
|
|
10
|
+
from ..syntax.stdattrs import oops_test_type, oops_expected_target
|
|
11
|
+
from .oopsroot import OOPSParallel, OOPSODB, OOPSMembersTermsDecoMixin, OOPSMembersTermsDetectDecoMixin
|
|
12
|
+
|
|
13
|
+
#: No automatic export
|
|
14
|
+
__all__ = []
|
|
15
|
+
|
|
16
|
+
logger = footprints.loggers.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@algo_component_deco_mixin_autodoc
|
|
20
|
+
class _OOPSTestDecoMixin(AlgoComponentDecoMixin):
|
|
21
|
+
"""Extend OOPSParallel Algo Components with OOPS Tests features.
|
|
22
|
+
|
|
23
|
+
This mixin class is intended to be used with AlgoComponent classes. It will
|
|
24
|
+
automatically add the ``test_type`` footprints' attribute and extend the
|
|
25
|
+
the dictionary that is used to build the binary' command line.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
_MIXIN_EXTRA_FOOTPRINTS = (oops_test_type, )
|
|
29
|
+
|
|
30
|
+
def _ooptest_cli_opts_extend(self, prev):
|
|
31
|
+
"""Prepare options for the resource's command line."""
|
|
32
|
+
prev['test_type'] = self.test_type
|
|
33
|
+
return prev
|
|
34
|
+
|
|
35
|
+
_MIXIN_CLI_OPTS_EXTEND = (_ooptest_cli_opts_extend, )
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@algo_component_deco_mixin_autodoc
|
|
39
|
+
class _OOPSTestExpTargetDecoMixin(AlgoComponentDecoMixin):
|
|
40
|
+
"""Extend OOPSParallel Algo Components with OOPS Tests verification features.
|
|
41
|
+
|
|
42
|
+
This mixin class is intended to be used with AlgoComponent classes. It will
|
|
43
|
+
automatically add the ``expected_target`` footprints' attribute and use it
|
|
44
|
+
to setup the associated environment variable
|
|
45
|
+
(see :meth:`set_expected_target`).
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
_MIXIN_EXTRA_FOOTPRINTS = (oops_expected_target,)
|
|
49
|
+
|
|
50
|
+
def set_expected_target(self):
|
|
51
|
+
"""Set env variable EXPECTED_CONFIG.
|
|
52
|
+
|
|
53
|
+
It will create it using a JSON "dump" of either:
|
|
54
|
+
|
|
55
|
+
* The Algo Component's attribute ``expected_target``;
|
|
56
|
+
* if attribute ``expected_target`` == {'from':'reference_summary'},
|
|
57
|
+
the oops:self.test_type 'as EXPECTED_RESULT' key of the JSON resource
|
|
58
|
+
of role "Reference Summary".
|
|
59
|
+
* a default value, enabling to pass test
|
|
60
|
+
"""
|
|
61
|
+
# if attribute 'expected_target' is attribute and given to the algo, use it
|
|
62
|
+
target = self._set_expected_target_from_attribute()
|
|
63
|
+
# else, go find Reference summary in effective inputs
|
|
64
|
+
if target is not None and target.get('from') == 'reference_summary':
|
|
65
|
+
target = self._set_expected_target_from_reference_summary()
|
|
66
|
+
# Else, default to be sure to pass any in-binary-test
|
|
67
|
+
if target is None:
|
|
68
|
+
target = self._set_expected_target_default() # CLEANME: to be removed after CY47 ?
|
|
69
|
+
# Then in the end, export variable
|
|
70
|
+
target = json.dumps(target)
|
|
71
|
+
logger.info("Expected Target for Test: " + target)
|
|
72
|
+
self.env.update(EXPECTED_RESULT=target)
|
|
73
|
+
|
|
74
|
+
def _set_expected_target_from_attribute(self):
|
|
75
|
+
"""Read target in Algo attribute."""
|
|
76
|
+
if hasattr(self, 'expected_target'):
|
|
77
|
+
if self.expected_target is not None:
|
|
78
|
+
target = self.expected_target
|
|
79
|
+
logger.info('Set EXPECTED_RESULT from Attribute')
|
|
80
|
+
return target
|
|
81
|
+
|
|
82
|
+
def _set_expected_target_from_reference_summary(self):
|
|
83
|
+
"""Read target in ReferenceSummary effective input"""
|
|
84
|
+
target = None
|
|
85
|
+
ref_summary = [s for s in self.context.sequence.effective_inputs(role=('Reference',))
|
|
86
|
+
if s.rh.resource.kind == 'taskinfo']
|
|
87
|
+
if len(ref_summary) > 0:
|
|
88
|
+
ref_summary = ref_summary[0].rh.contents.data
|
|
89
|
+
target = ref_summary.get('oops:' + self.test_type,
|
|
90
|
+
{}).get('as EXPECTED_RESULT', None)
|
|
91
|
+
if target is not None:
|
|
92
|
+
logger.info('Set EXPECTED_RESULT from Reference summary')
|
|
93
|
+
return target
|
|
94
|
+
|
|
95
|
+
def _set_expected_target_default(self): # CLEANME: to be removed after CY47 ?
|
|
96
|
+
"""Set default, for binary not to crash before CY47."""
|
|
97
|
+
target = {'significant_digits': '-9',
|
|
98
|
+
'expected_Jo': '9999',
|
|
99
|
+
'expected_variances': '9999',
|
|
100
|
+
'expected_diff': '9999'}
|
|
101
|
+
logger.info('Set default EXPECTED_RESULT')
|
|
102
|
+
return target
|
|
103
|
+
|
|
104
|
+
def _ooptest_exptarget_prepare_hook(self, rh, opts):
|
|
105
|
+
"""Call set_expected_target juste after prepare."""
|
|
106
|
+
self.set_expected_target()
|
|
107
|
+
|
|
108
|
+
_MIXIN_PREPARE_HOOKS = (_ooptest_exptarget_prepare_hook, )
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class OOPSTest(OOPSParallel, _OOPSTestDecoMixin, _OOPSTestExpTargetDecoMixin,
|
|
112
|
+
OOPSMembersTermsDetectDecoMixin):
|
|
113
|
+
"""OOPS Tests without ODB."""
|
|
114
|
+
|
|
115
|
+
_footprint = dict(
|
|
116
|
+
info = "OOPS Test run.",
|
|
117
|
+
attr = dict(
|
|
118
|
+
kind = dict(
|
|
119
|
+
values = ['ootest'],
|
|
120
|
+
),
|
|
121
|
+
test_type = dict(
|
|
122
|
+
outcast = ['ensemble/build', ]
|
|
123
|
+
),
|
|
124
|
+
)
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class OOPSTestEnsBuild(OOPSParallel, _OOPSTestDecoMixin, OOPSMembersTermsDecoMixin):
|
|
129
|
+
"""OOPS Tests without ODB: ensemble/build specific case"""
|
|
130
|
+
|
|
131
|
+
_footprint = dict(
|
|
132
|
+
info = "OOPS Test run.",
|
|
133
|
+
attr = dict(
|
|
134
|
+
kind = dict(
|
|
135
|
+
values = ['ootest'],
|
|
136
|
+
),
|
|
137
|
+
test_type = dict(
|
|
138
|
+
values = ['ensemble/build', ]
|
|
139
|
+
),
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class OOPSObsOpTest(OOPSODB, _OOPSTestDecoMixin, _OOPSTestExpTargetDecoMixin,
|
|
145
|
+
OOPSMembersTermsDetectDecoMixin):
|
|
146
|
+
"""OOPS Obs Operators Tests."""
|
|
147
|
+
|
|
148
|
+
_footprint = dict(
|
|
149
|
+
info = "OOPS Obs Operators Tests.",
|
|
150
|
+
attr = dict(
|
|
151
|
+
kind = dict(
|
|
152
|
+
values = ['ootestobs'],
|
|
153
|
+
),
|
|
154
|
+
virtualdb = dict(
|
|
155
|
+
default = 'ccma',
|
|
156
|
+
),
|
|
157
|
+
)
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class OOPSecma2ccma(OOPSODB, _OOPSTestDecoMixin):
|
|
162
|
+
"""OOPS Test ECMA 2 CCMA completer."""
|
|
163
|
+
|
|
164
|
+
_footprint = dict(
|
|
165
|
+
info = "OOPS ECMA 2 CCMA completer.",
|
|
166
|
+
attr = dict(
|
|
167
|
+
kind = dict(
|
|
168
|
+
values = ['ootest2ccma'],
|
|
169
|
+
),
|
|
170
|
+
virtualdb = dict(
|
|
171
|
+
values = ['ecma'],
|
|
172
|
+
),
|
|
173
|
+
)
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
def postfix(self, rh, opts):
|
|
177
|
+
"""Rename the ECMA database once OOPS has run."""
|
|
178
|
+
super().postfix(rh, opts)
|
|
179
|
+
self._mv_ecma2ccma()
|
|
180
|
+
|
|
181
|
+
def _mv_ecma2ccma(self):
|
|
182
|
+
"""Make the appropriate renaming of files in ECMA to CCMA."""
|
|
183
|
+
for e in self.lookupodb():
|
|
184
|
+
edir = e.rh.container.localpath()
|
|
185
|
+
self.odb.change_layout('ECMA', 'CCMA', edir)
|
|
186
|
+
self.system.mv(edir, edir.replace('ECMA', 'CCMA'))
|