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
vortex/data/resources.py
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Abstract class for any "Resource". "Resource" objects describe what is in this
|
|
3
|
+
or that data.
|
|
4
|
+
|
|
5
|
+
:seealso: The :mod:`~vortex.data.flow`, :mod:`~vortex.data.outflow`,
|
|
6
|
+
:mod:`~vortex.data.executables` or :mod:`~gco.data.resources` for more
|
|
7
|
+
specialised versions that may better fit your needs.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from bronx.fancies import loggers
|
|
11
|
+
from bronx.stdtypes.dictionaries import LowerCaseDict
|
|
12
|
+
|
|
13
|
+
import footprints
|
|
14
|
+
|
|
15
|
+
from vortex.syntax.stdattrs import nativefmt_deco, notinrepr, term_deco
|
|
16
|
+
from .contents import DataContent, UnknownContent, FormatAdapter
|
|
17
|
+
|
|
18
|
+
#: Export Resource and associated Catalog classes.
|
|
19
|
+
__all__ = ['Resource', ]
|
|
20
|
+
|
|
21
|
+
logger = loggers.getLogger(__name__)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Resource(footprints.FootprintBase):
|
|
25
|
+
"""Abstract class for any Resource."""
|
|
26
|
+
|
|
27
|
+
_abstract = True
|
|
28
|
+
_collector = ('resource',)
|
|
29
|
+
_footprint = [
|
|
30
|
+
nativefmt_deco,
|
|
31
|
+
dict(
|
|
32
|
+
info = 'Abstract Resource',
|
|
33
|
+
attr = dict(
|
|
34
|
+
clscontents = dict(
|
|
35
|
+
info = "The class instantiated to read the container's content",
|
|
36
|
+
type = DataContent,
|
|
37
|
+
isclass = True,
|
|
38
|
+
optional = True,
|
|
39
|
+
default = UnknownContent,
|
|
40
|
+
doc_visibility = footprints.doc.visibility.ADVANCED,
|
|
41
|
+
)
|
|
42
|
+
),
|
|
43
|
+
fastkeys = {'kind', 'nativefmt'}
|
|
44
|
+
)
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
def __init__(self, *args, **kw):
|
|
48
|
+
logger.debug('Resource init %s', self.__class__)
|
|
49
|
+
super().__init__(*args, **kw)
|
|
50
|
+
self._mailbox = LowerCaseDict()
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def realkind(self):
|
|
54
|
+
return 'resource'
|
|
55
|
+
|
|
56
|
+
def _str_more(self):
|
|
57
|
+
"""Return a string representation of meaningful attributes for formatted output."""
|
|
58
|
+
d = self.footprint_as_shallow_dict()
|
|
59
|
+
for xdel in [x for x in notinrepr if x in d]:
|
|
60
|
+
del d[xdel]
|
|
61
|
+
return ' '.join(['{:s}=\'{!s}\''.format(k, v) for k, v in d.items()])
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def mailbox(self):
|
|
65
|
+
"""A nice cocoon to store miscellaneous information."""
|
|
66
|
+
return self._mailbox
|
|
67
|
+
|
|
68
|
+
def generic_pathinfo(self):
|
|
69
|
+
"""
|
|
70
|
+
Returns anonymous dict with suitable informations from vortex point of view.
|
|
71
|
+
Doomed to be overwritten.
|
|
72
|
+
"""
|
|
73
|
+
return dict()
|
|
74
|
+
|
|
75
|
+
def pathinfo(self, provider):
|
|
76
|
+
"""Proxy to the appropriate method prefixed by provider name."""
|
|
77
|
+
actualpathinfo = getattr(self, provider + '_pathinfo', self.generic_pathinfo)
|
|
78
|
+
return actualpathinfo()
|
|
79
|
+
|
|
80
|
+
def generic_basename(self):
|
|
81
|
+
"""Abstract method."""
|
|
82
|
+
pass
|
|
83
|
+
|
|
84
|
+
def basename(self, provider):
|
|
85
|
+
"""Proxy to the appropriate method prefixed by provider name."""
|
|
86
|
+
actualbasename = getattr(self, provider + '_basename', self.generic_basename)
|
|
87
|
+
return actualbasename()
|
|
88
|
+
|
|
89
|
+
def namebuilding_info(self):
|
|
90
|
+
"""
|
|
91
|
+
Returns anonymous dict with suitable informations from vortex point of view.
|
|
92
|
+
In real world, probably doomed to return an empty dict.
|
|
93
|
+
"""
|
|
94
|
+
return {'radical': self.realkind}
|
|
95
|
+
|
|
96
|
+
def vortex_urlquery(self):
|
|
97
|
+
"""Query to be binded to the resource's location in vortex space."""
|
|
98
|
+
return None
|
|
99
|
+
|
|
100
|
+
def urlquery(self, provider):
|
|
101
|
+
"""Proxy to the appropriate method prefixed by provider name."""
|
|
102
|
+
actualurlquery = getattr(self, provider + '_urlquery', self.vortex_urlquery)
|
|
103
|
+
return actualurlquery()
|
|
104
|
+
|
|
105
|
+
def gget_basename(self):
|
|
106
|
+
"""Duck typing: return an empty string by default."""
|
|
107
|
+
return dict()
|
|
108
|
+
|
|
109
|
+
def uget_basename(self):
|
|
110
|
+
"""Proxy to :meth:`gget_basename`."""
|
|
111
|
+
return self.gget_basename()
|
|
112
|
+
|
|
113
|
+
def genv_basename(self):
|
|
114
|
+
"""Just retrieve a potential gvar attribute."""
|
|
115
|
+
return getattr(self, 'gvar', '')
|
|
116
|
+
|
|
117
|
+
def uenv_basename(self):
|
|
118
|
+
"""Proxy to :meth:`genv_basename`."""
|
|
119
|
+
return self.genv_basename()
|
|
120
|
+
|
|
121
|
+
def gget_urlquery(self):
|
|
122
|
+
"""Duck typing: return an empty string by default."""
|
|
123
|
+
return ''
|
|
124
|
+
|
|
125
|
+
def uget_urlquery(self):
|
|
126
|
+
"""Proxy to :meth:`gget_urlquery`."""
|
|
127
|
+
return self.gget_urlquery()
|
|
128
|
+
|
|
129
|
+
def genv_urlquery(self):
|
|
130
|
+
"""Proxy to :meth:`gget_urlquery`."""
|
|
131
|
+
return self.gget_urlquery()
|
|
132
|
+
|
|
133
|
+
def uenv_urlquery(self):
|
|
134
|
+
"""Proxy to :meth:`gget_urlquery`."""
|
|
135
|
+
return self.gget_urlquery()
|
|
136
|
+
|
|
137
|
+
def contents_args(self):
|
|
138
|
+
"""Returns default arguments value to class content constructor."""
|
|
139
|
+
return dict()
|
|
140
|
+
|
|
141
|
+
def contents_handler(self, **kw):
|
|
142
|
+
"""Returns class content handler according to attribute ``clscontents``."""
|
|
143
|
+
this_args = self.contents_args()
|
|
144
|
+
this_args.update(kw)
|
|
145
|
+
return self.clscontents(**this_args)
|
|
146
|
+
|
|
147
|
+
def stackedstorage_resource(self):
|
|
148
|
+
"""
|
|
149
|
+
If the present resource supports stacked storage (note: this feature is
|
|
150
|
+
only available in the Vortex store), return the corresponding resource
|
|
151
|
+
plus a boolean indicating if data from different members are kept
|
|
152
|
+
separate.
|
|
153
|
+
"""
|
|
154
|
+
return None, True
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class Unknown(Resource):
|
|
158
|
+
|
|
159
|
+
_footprint = [
|
|
160
|
+
dict(
|
|
161
|
+
info = 'Unknown assumed NWP Resource (development only !)',
|
|
162
|
+
attr = dict(
|
|
163
|
+
unknown = dict(
|
|
164
|
+
info = "Activate the unknown resource.",
|
|
165
|
+
type = bool
|
|
166
|
+
),
|
|
167
|
+
nickname = dict(
|
|
168
|
+
info = "The string that serves the purpose of Vortex's basename radical",
|
|
169
|
+
optional = True,
|
|
170
|
+
default = 'unknown'
|
|
171
|
+
),
|
|
172
|
+
clscontents = dict(
|
|
173
|
+
default = FormatAdapter,
|
|
174
|
+
),
|
|
175
|
+
),
|
|
176
|
+
fastkeys = {'unknown'},
|
|
177
|
+
)
|
|
178
|
+
]
|
|
179
|
+
|
|
180
|
+
def namebuilding_info(self):
|
|
181
|
+
"""Keep the Unknown resource unknown."""
|
|
182
|
+
bdict = super().namebuilding_info()
|
|
183
|
+
bdict.update(radical=self.nickname, )
|
|
184
|
+
if self.nativefmt in ('auto', 'autoconfig', 'foo', 'unknown'):
|
|
185
|
+
del bdict['fmt']
|
|
186
|
+
return bdict
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class UnknownWithTerm(Unknown):
|
|
190
|
+
_footprint = [
|
|
191
|
+
term_deco,
|
|
192
|
+
dict(
|
|
193
|
+
info = 'Unknown assumed NWP Resource but with term (development only !)',
|
|
194
|
+
),
|
|
195
|
+
]
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
# Activate the footprint's fasttrack on the resources collector
|
|
199
|
+
fcollect = footprints.collectors.get(tag='resource')
|
|
200
|
+
fcollect.fasttrack = ('kind', )
|
|
201
|
+
del fcollect
|