vortex-nwp 2.0.0b1__py3-none-any.whl → 2.0.0b2__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 +59 -45
- vortex/algo/__init__.py +3 -2
- vortex/algo/components.py +940 -614
- vortex/algo/mpitools.py +802 -497
- vortex/algo/serversynctools.py +34 -33
- vortex/config.py +19 -22
- vortex/data/__init__.py +9 -3
- vortex/data/abstractstores.py +593 -655
- vortex/data/containers.py +217 -162
- vortex/data/contents.py +65 -39
- vortex/data/executables.py +93 -102
- vortex/data/flow.py +40 -34
- vortex/data/geometries.py +228 -132
- vortex/data/handlers.py +428 -225
- vortex/data/outflow.py +15 -15
- vortex/data/providers.py +185 -163
- vortex/data/resources.py +48 -42
- vortex/data/stores.py +544 -413
- vortex/gloves.py +114 -87
- vortex/layout/__init__.py +1 -8
- vortex/layout/contexts.py +150 -84
- vortex/layout/dataflow.py +353 -202
- vortex/layout/monitor.py +264 -128
- vortex/nwp/__init__.py +5 -2
- vortex/nwp/algo/__init__.py +14 -5
- vortex/nwp/algo/assim.py +205 -151
- vortex/nwp/algo/clim.py +683 -517
- vortex/nwp/algo/coupling.py +447 -225
- vortex/nwp/algo/eda.py +437 -229
- vortex/nwp/algo/eps.py +403 -231
- vortex/nwp/algo/forecasts.py +420 -271
- vortex/nwp/algo/fpserver.py +683 -307
- vortex/nwp/algo/ifsnaming.py +205 -145
- vortex/nwp/algo/ifsroot.py +210 -122
- vortex/nwp/algo/monitoring.py +132 -76
- vortex/nwp/algo/mpitools.py +321 -191
- vortex/nwp/algo/odbtools.py +617 -353
- vortex/nwp/algo/oopsroot.py +449 -273
- vortex/nwp/algo/oopstests.py +90 -56
- vortex/nwp/algo/request.py +287 -206
- vortex/nwp/algo/stdpost.py +878 -522
- vortex/nwp/data/__init__.py +22 -4
- vortex/nwp/data/assim.py +125 -137
- vortex/nwp/data/boundaries.py +121 -68
- vortex/nwp/data/climfiles.py +193 -211
- vortex/nwp/data/configfiles.py +73 -69
- vortex/nwp/data/consts.py +426 -401
- vortex/nwp/data/ctpini.py +59 -43
- vortex/nwp/data/diagnostics.py +94 -66
- vortex/nwp/data/eda.py +50 -51
- vortex/nwp/data/eps.py +195 -146
- vortex/nwp/data/executables.py +440 -434
- vortex/nwp/data/fields.py +63 -48
- vortex/nwp/data/gridfiles.py +183 -111
- vortex/nwp/data/logs.py +250 -217
- vortex/nwp/data/modelstates.py +180 -151
- vortex/nwp/data/monitoring.py +72 -99
- vortex/nwp/data/namelists.py +254 -202
- vortex/nwp/data/obs.py +400 -308
- vortex/nwp/data/oopsexec.py +22 -20
- vortex/nwp/data/providers.py +90 -65
- vortex/nwp/data/query.py +71 -82
- vortex/nwp/data/stores.py +49 -36
- vortex/nwp/data/surfex.py +136 -137
- vortex/nwp/syntax/__init__.py +1 -1
- vortex/nwp/syntax/stdattrs.py +173 -111
- vortex/nwp/tools/__init__.py +2 -2
- vortex/nwp/tools/addons.py +22 -17
- vortex/nwp/tools/agt.py +24 -12
- vortex/nwp/tools/bdap.py +16 -5
- vortex/nwp/tools/bdcp.py +4 -1
- vortex/nwp/tools/bdm.py +3 -0
- vortex/nwp/tools/bdmp.py +14 -9
- vortex/nwp/tools/conftools.py +728 -378
- vortex/nwp/tools/drhook.py +12 -8
- vortex/nwp/tools/grib.py +65 -39
- vortex/nwp/tools/gribdiff.py +22 -17
- vortex/nwp/tools/ifstools.py +82 -42
- vortex/nwp/tools/igastuff.py +167 -143
- vortex/nwp/tools/mars.py +14 -2
- vortex/nwp/tools/odb.py +234 -125
- vortex/nwp/tools/partitioning.py +61 -37
- vortex/nwp/tools/satrad.py +27 -12
- vortex/nwp/util/async.py +83 -55
- vortex/nwp/util/beacon.py +10 -10
- vortex/nwp/util/diffpygram.py +174 -86
- vortex/nwp/util/ens.py +144 -63
- vortex/nwp/util/hooks.py +30 -19
- vortex/nwp/util/taskdeco.py +28 -24
- vortex/nwp/util/usepygram.py +278 -172
- vortex/nwp/util/usetnt.py +31 -17
- vortex/sessions.py +72 -39
- vortex/syntax/__init__.py +1 -1
- vortex/syntax/stdattrs.py +410 -171
- vortex/syntax/stddeco.py +31 -22
- vortex/toolbox.py +327 -192
- vortex/tools/__init__.py +11 -2
- vortex/tools/actions.py +125 -59
- vortex/tools/addons.py +111 -92
- vortex/tools/arm.py +42 -22
- vortex/tools/compression.py +72 -69
- vortex/tools/date.py +11 -4
- vortex/tools/delayedactions.py +242 -132
- vortex/tools/env.py +75 -47
- vortex/tools/folder.py +342 -171
- vortex/tools/grib.py +311 -149
- vortex/tools/lfi.py +423 -216
- vortex/tools/listings.py +109 -40
- vortex/tools/names.py +218 -156
- vortex/tools/net.py +632 -298
- vortex/tools/parallelism.py +93 -61
- vortex/tools/prestaging.py +55 -31
- vortex/tools/schedulers.py +172 -105
- vortex/tools/services.py +402 -333
- vortex/tools/storage.py +293 -358
- vortex/tools/surfex.py +24 -24
- vortex/tools/systems.py +1211 -631
- vortex/tools/targets.py +156 -100
- vortex/util/__init__.py +1 -1
- vortex/util/config.py +377 -327
- vortex/util/empty.py +2 -2
- vortex/util/helpers.py +56 -24
- vortex/util/introspection.py +18 -12
- vortex/util/iosponge.py +8 -4
- vortex/util/roles.py +4 -6
- vortex/util/storefunctions.py +39 -13
- vortex/util/structs.py +3 -3
- vortex/util/worker.py +29 -17
- vortex_nwp-2.0.0b2.dist-info/METADATA +66 -0
- vortex_nwp-2.0.0b2.dist-info/RECORD +142 -0
- {vortex_nwp-2.0.0b1.dist-info → vortex_nwp-2.0.0b2.dist-info}/WHEEL +1 -1
- vortex/layout/appconf.py +0 -109
- vortex/layout/jobs.py +0 -1276
- vortex/layout/nodes.py +0 -1424
- vortex/layout/subjobs.py +0 -464
- vortex_nwp-2.0.0b1.dist-info/METADATA +0 -50
- vortex_nwp-2.0.0b1.dist-info/RECORD +0 -146
- {vortex_nwp-2.0.0b1.dist-info → vortex_nwp-2.0.0b2.dist-info}/LICENSE +0 -0
- {vortex_nwp-2.0.0b1.dist-info → vortex_nwp-2.0.0b2.dist-info}/top_level.txt +0 -0
vortex/data/outflow.py
CHANGED
|
@@ -17,13 +17,12 @@ __all__ = []
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class StaticResource(Resource):
|
|
20
|
-
|
|
21
20
|
_abstract = True
|
|
22
21
|
_footprint = dict(
|
|
23
|
-
attr
|
|
24
|
-
kind
|
|
25
|
-
info
|
|
26
|
-
doc_zorder
|
|
22
|
+
attr=dict(
|
|
23
|
+
kind=dict(
|
|
24
|
+
info="The resource's kind.",
|
|
25
|
+
doc_zorder=90,
|
|
27
26
|
),
|
|
28
27
|
)
|
|
29
28
|
)
|
|
@@ -36,19 +35,20 @@ class StaticGeoResource(StaticResource):
|
|
|
36
35
|
_footprint = [
|
|
37
36
|
hgeometry_deco,
|
|
38
37
|
dict(
|
|
39
|
-
attr
|
|
40
|
-
clscontents
|
|
41
|
-
default
|
|
38
|
+
attr=dict(
|
|
39
|
+
clscontents=dict(
|
|
40
|
+
default=FormatAdapter,
|
|
42
41
|
),
|
|
43
42
|
)
|
|
44
|
-
)
|
|
43
|
+
),
|
|
45
44
|
]
|
|
46
45
|
|
|
47
46
|
|
|
48
47
|
class ModelResource(StaticResource):
|
|
49
|
-
|
|
50
48
|
_abstract = True
|
|
51
|
-
_footprint = [
|
|
49
|
+
_footprint = [
|
|
50
|
+
model_deco,
|
|
51
|
+
]
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
class ModelGeoResource(ModelResource):
|
|
@@ -58,10 +58,10 @@ class ModelGeoResource(ModelResource):
|
|
|
58
58
|
_footprint = [
|
|
59
59
|
hgeometry_deco,
|
|
60
60
|
dict(
|
|
61
|
-
attr
|
|
62
|
-
clscontents
|
|
63
|
-
default
|
|
61
|
+
attr=dict(
|
|
62
|
+
clscontents=dict(
|
|
63
|
+
default=FormatAdapter,
|
|
64
64
|
),
|
|
65
65
|
)
|
|
66
|
-
)
|
|
66
|
+
),
|
|
67
67
|
]
|
vortex/data/providers.py
CHANGED
|
@@ -6,30 +6,26 @@ Of course, the :class:`Vortex` abstract provider is a must see. It has three
|
|
|
6
6
|
declinations depending on the experiment indentifier type.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
import collections
|
|
10
|
-
import operator
|
|
11
9
|
import os.path
|
|
12
|
-
import re
|
|
13
10
|
from urllib import parse as urlparse
|
|
14
11
|
import warnings
|
|
15
12
|
|
|
16
13
|
from bronx.fancies import loggers
|
|
17
|
-
from bronx.syntax.parsing import StringDecoder
|
|
18
14
|
import footprints
|
|
19
15
|
from footprints import proxy as fpx
|
|
20
|
-
from footprints.stdtypes import FPDict
|
|
21
16
|
|
|
22
|
-
from vortex import sessions
|
|
23
17
|
from vortex import config
|
|
24
|
-
from vortex.syntax.stdattrs import
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
from vortex.syntax.stdattrs import (
|
|
19
|
+
xpid,
|
|
20
|
+
scenario,
|
|
21
|
+
member,
|
|
22
|
+
block,
|
|
23
|
+
)
|
|
24
|
+
from vortex.syntax.stdattrs import namespacefp, FmtInt
|
|
28
25
|
from vortex.tools import net, names
|
|
29
|
-
from vortex.util.config import GenericConfigParser
|
|
30
26
|
|
|
31
27
|
#: No automatic export
|
|
32
|
-
__all__ = [
|
|
28
|
+
__all__ = ["Provider"]
|
|
33
29
|
|
|
34
30
|
logger = loggers.getLogger(__name__)
|
|
35
31
|
|
|
@@ -38,48 +34,48 @@ class Provider(footprints.FootprintBase):
|
|
|
38
34
|
"""Abstract class for any Provider."""
|
|
39
35
|
|
|
40
36
|
_abstract = True
|
|
41
|
-
_collector = (
|
|
37
|
+
_collector = ("provider",)
|
|
42
38
|
_footprint = dict(
|
|
43
|
-
info
|
|
44
|
-
attr
|
|
45
|
-
vapp
|
|
46
|
-
info
|
|
47
|
-
alias
|
|
48
|
-
optional
|
|
49
|
-
default
|
|
50
|
-
doc_zorder
|
|
39
|
+
info="Abstract root provider",
|
|
40
|
+
attr=dict(
|
|
41
|
+
vapp=dict(
|
|
42
|
+
info="The application's identifier.",
|
|
43
|
+
alias=("application",),
|
|
44
|
+
optional=True,
|
|
45
|
+
default="[glove::vapp]",
|
|
46
|
+
doc_zorder=-10,
|
|
51
47
|
),
|
|
52
|
-
vconf
|
|
53
|
-
info
|
|
54
|
-
alias
|
|
55
|
-
optional
|
|
56
|
-
default
|
|
57
|
-
doc_zorder
|
|
48
|
+
vconf=dict(
|
|
49
|
+
info="The configuration's identifier.",
|
|
50
|
+
alias=("configuration",),
|
|
51
|
+
optional=True,
|
|
52
|
+
default="[glove::vconf]",
|
|
53
|
+
doc_zorder=-10,
|
|
58
54
|
),
|
|
59
|
-
username
|
|
60
|
-
info
|
|
61
|
-
optional
|
|
62
|
-
default
|
|
63
|
-
alias
|
|
55
|
+
username=dict(
|
|
56
|
+
info="The username that will be used whenever necessary.",
|
|
57
|
+
optional=True,
|
|
58
|
+
default=None,
|
|
59
|
+
alias=("user", "logname"),
|
|
64
60
|
),
|
|
65
61
|
),
|
|
66
|
-
fastkeys
|
|
62
|
+
fastkeys={"namespace"},
|
|
67
63
|
)
|
|
68
64
|
|
|
69
65
|
def __init__(self, *args, **kw):
|
|
70
|
-
logger.debug(
|
|
66
|
+
logger.debug("Abstract provider init %s", self.__class__)
|
|
71
67
|
super().__init__(*args, **kw)
|
|
72
68
|
|
|
73
69
|
def _str_more(self):
|
|
74
70
|
"""Additional information to print representation."""
|
|
75
71
|
try:
|
|
76
|
-
return
|
|
72
|
+
return "namespace='{:s}'".format(self.namespace)
|
|
77
73
|
except AttributeError:
|
|
78
74
|
return super()._str_more()
|
|
79
75
|
|
|
80
76
|
@property
|
|
81
77
|
def realkind(self):
|
|
82
|
-
return
|
|
78
|
+
return "provider"
|
|
83
79
|
|
|
84
80
|
def scheme(self, resource):
|
|
85
81
|
"""Abstract method."""
|
|
@@ -123,61 +119,67 @@ class Provider(footprints.FootprintBase):
|
|
|
123
119
|
The different operations of the algorithm can be redefined by subclasses.
|
|
124
120
|
"""
|
|
125
121
|
username = self.netuser_name(resource)
|
|
126
|
-
fullnetloc = (
|
|
127
|
-
|
|
122
|
+
fullnetloc = (
|
|
123
|
+
"{:s}@{:s}".format(username, self.netloc(resource))
|
|
124
|
+
if username
|
|
125
|
+
else self.netloc(resource)
|
|
126
|
+
)
|
|
128
127
|
logger.debug(
|
|
129
|
-
|
|
128
|
+
"scheme %s netloc %s normpath %s urlquery %s",
|
|
130
129
|
self.scheme(resource),
|
|
131
130
|
fullnetloc,
|
|
132
|
-
os.path.normpath(
|
|
133
|
-
|
|
131
|
+
os.path.normpath(
|
|
132
|
+
self.pathname(resource) + "/" + self.basename(resource)
|
|
133
|
+
),
|
|
134
|
+
self.urlquery(resource),
|
|
134
135
|
)
|
|
135
136
|
|
|
136
|
-
return net.uriunparse(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
return net.uriunparse(
|
|
138
|
+
(
|
|
139
|
+
self.scheme(resource),
|
|
140
|
+
fullnetloc,
|
|
141
|
+
os.path.normpath(
|
|
142
|
+
self.pathname(resource) + "/" + self.basename(resource)
|
|
143
|
+
),
|
|
144
|
+
None,
|
|
145
|
+
self.urlquery(resource),
|
|
146
|
+
None,
|
|
147
|
+
)
|
|
148
|
+
)
|
|
144
149
|
|
|
145
150
|
|
|
146
151
|
class Magic(Provider):
|
|
147
|
-
|
|
148
152
|
_footprint = [
|
|
149
153
|
xpid,
|
|
150
154
|
dict(
|
|
151
|
-
info
|
|
152
|
-
attr
|
|
153
|
-
fake
|
|
154
|
-
info
|
|
155
|
-
alias
|
|
156
|
-
type
|
|
157
|
-
optional
|
|
158
|
-
default
|
|
155
|
+
info="Magic provider that always returns the same URI.",
|
|
156
|
+
attr=dict(
|
|
157
|
+
fake=dict(
|
|
158
|
+
info="Enable this magic provider.",
|
|
159
|
+
alias=("nowhere", "noprovider"),
|
|
160
|
+
type=bool,
|
|
161
|
+
optional=True,
|
|
162
|
+
default=True,
|
|
159
163
|
),
|
|
160
|
-
magic
|
|
161
|
-
|
|
164
|
+
magic=dict(info="The URI returned by this provider."),
|
|
165
|
+
experiment=dict(
|
|
166
|
+
optional=True,
|
|
167
|
+
doc_visibility=footprints.doc.visibility.ADVANCED,
|
|
162
168
|
),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
doc_visibility = footprints.doc.visibility.ADVANCED,
|
|
169
|
+
vapp=dict(
|
|
170
|
+
doc_visibility=footprints.doc.visibility.GURU,
|
|
166
171
|
),
|
|
167
|
-
|
|
168
|
-
doc_visibility
|
|
169
|
-
),
|
|
170
|
-
vconf = dict(
|
|
171
|
-
doc_visibility = footprints.doc.visibility.GURU,
|
|
172
|
+
vconf=dict(
|
|
173
|
+
doc_visibility=footprints.doc.visibility.GURU,
|
|
172
174
|
),
|
|
173
175
|
),
|
|
174
|
-
fastkeys
|
|
175
|
-
)
|
|
176
|
+
fastkeys={"magic"},
|
|
177
|
+
),
|
|
176
178
|
]
|
|
177
179
|
|
|
178
180
|
@property
|
|
179
181
|
def realkind(self):
|
|
180
|
-
return
|
|
182
|
+
return "magic"
|
|
181
183
|
|
|
182
184
|
def uri(self, resource):
|
|
183
185
|
"""URI is supposed to be the magic value !"""
|
|
@@ -185,47 +187,46 @@ class Magic(Provider):
|
|
|
185
187
|
|
|
186
188
|
|
|
187
189
|
class Remote(Provider):
|
|
188
|
-
|
|
189
190
|
_footprint = dict(
|
|
190
|
-
info
|
|
191
|
-
attr
|
|
192
|
-
remote
|
|
193
|
-
info
|
|
194
|
-
alias
|
|
195
|
-
doc_zorder
|
|
191
|
+
info="Provider that manipulates data given a real path",
|
|
192
|
+
attr=dict(
|
|
193
|
+
remote=dict(
|
|
194
|
+
info="The path to the data.",
|
|
195
|
+
alias=("remfile", "rempath"),
|
|
196
|
+
doc_zorder=50,
|
|
196
197
|
),
|
|
197
|
-
hostname
|
|
198
|
-
info
|
|
199
|
-
optional
|
|
200
|
-
default
|
|
198
|
+
hostname=dict(
|
|
199
|
+
info="The hostname that holds the data.",
|
|
200
|
+
optional=True,
|
|
201
|
+
default="localhost",
|
|
201
202
|
),
|
|
202
|
-
tube
|
|
203
|
-
info
|
|
204
|
-
optional
|
|
205
|
-
values
|
|
206
|
-
default
|
|
203
|
+
tube=dict(
|
|
204
|
+
info="The protocol used to access the data.",
|
|
205
|
+
optional=True,
|
|
206
|
+
values=["scp", "ftp", "rcp", "file", "symlink"],
|
|
207
|
+
default="file",
|
|
207
208
|
),
|
|
208
|
-
vapp
|
|
209
|
-
doc_visibility
|
|
209
|
+
vapp=dict(
|
|
210
|
+
doc_visibility=footprints.doc.visibility.GURU,
|
|
210
211
|
),
|
|
211
|
-
vconf
|
|
212
|
-
doc_visibility
|
|
212
|
+
vconf=dict(
|
|
213
|
+
doc_visibility=footprints.doc.visibility.GURU,
|
|
213
214
|
),
|
|
214
215
|
),
|
|
215
|
-
fastkeys
|
|
216
|
+
fastkeys={"remote"},
|
|
216
217
|
)
|
|
217
218
|
|
|
218
219
|
def __init__(self, *args, **kw):
|
|
219
|
-
logger.debug(
|
|
220
|
+
logger.debug("Remote provider init %s", self.__class__)
|
|
220
221
|
super().__init__(*args, **kw)
|
|
221
222
|
|
|
222
223
|
@property
|
|
223
224
|
def realkind(self):
|
|
224
|
-
return
|
|
225
|
+
return "remote"
|
|
225
226
|
|
|
226
227
|
def _str_more(self):
|
|
227
228
|
"""Additional information to print representation."""
|
|
228
|
-
return
|
|
229
|
+
return "path='{:s}'".format(self.remote)
|
|
229
230
|
|
|
230
231
|
def scheme(self, resource):
|
|
231
232
|
"""The Remote scheme is its tube."""
|
|
@@ -245,10 +246,10 @@ class Remote(Provider):
|
|
|
245
246
|
|
|
246
247
|
def urlquery(self, resource):
|
|
247
248
|
"""Check for relative path or not."""
|
|
248
|
-
if self.remote.startswith(
|
|
249
|
+
if self.remote.startswith("/"):
|
|
249
250
|
return None
|
|
250
251
|
else:
|
|
251
|
-
return
|
|
252
|
+
return "relative=1"
|
|
252
253
|
|
|
253
254
|
|
|
254
255
|
def set_namespace_from_cache_settings(usecache, usearchive):
|
|
@@ -285,72 +286,81 @@ class Vortex(Provider):
|
|
|
285
286
|
scenario,
|
|
286
287
|
namespacefp,
|
|
287
288
|
dict(
|
|
288
|
-
info
|
|
289
|
-
attr
|
|
290
|
-
experiment
|
|
291
|
-
info
|
|
292
|
-
type
|
|
293
|
-
optional
|
|
294
|
-
access
|
|
289
|
+
info="Vortex provider",
|
|
290
|
+
attr=dict(
|
|
291
|
+
experiment=dict(
|
|
292
|
+
info="Provider experiment id",
|
|
293
|
+
type=str,
|
|
294
|
+
optional=False,
|
|
295
|
+
access="rwx",
|
|
295
296
|
),
|
|
296
|
-
member
|
|
297
|
-
type
|
|
298
|
-
args
|
|
297
|
+
member=dict(
|
|
298
|
+
type=FmtInt,
|
|
299
|
+
args=dict(fmt="03"),
|
|
299
300
|
),
|
|
300
|
-
namespace
|
|
301
|
-
values
|
|
302
|
-
|
|
303
|
-
|
|
301
|
+
namespace=dict(
|
|
302
|
+
values=[
|
|
303
|
+
"vortex.cache.fr",
|
|
304
|
+
"vortex.archive.fr",
|
|
305
|
+
"vortex.multi.fr",
|
|
306
|
+
"vortex.stack.fr",
|
|
307
|
+
"open.cache.fr",
|
|
308
|
+
"open.archive.fr",
|
|
309
|
+
"open.multi.fr",
|
|
310
|
+
"open.stack.fr",
|
|
304
311
|
],
|
|
305
|
-
remap
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
312
|
+
remap={
|
|
313
|
+
"open.cache.fr": "vortex.cache.fr",
|
|
314
|
+
"open.archive.fr": "vortex.archive.fr",
|
|
315
|
+
"open.multi.fr": "vortex.multi.fr",
|
|
316
|
+
"open.stack.fr": "vortex.stack.fr",
|
|
310
317
|
},
|
|
311
|
-
optional
|
|
312
|
-
default
|
|
313
|
-
access
|
|
318
|
+
optional=True,
|
|
319
|
+
default=None,
|
|
320
|
+
access="rwx",
|
|
314
321
|
),
|
|
315
|
-
cache
|
|
316
|
-
info
|
|
317
|
-
type
|
|
318
|
-
optional
|
|
319
|
-
default
|
|
322
|
+
cache=dict(
|
|
323
|
+
info="Whether or not to use the cache",
|
|
324
|
+
type=bool,
|
|
325
|
+
optional=True,
|
|
326
|
+
default=None,
|
|
320
327
|
),
|
|
321
|
-
archive
|
|
322
|
-
info
|
|
323
|
-
type
|
|
324
|
-
optional
|
|
325
|
-
default
|
|
328
|
+
archive=dict(
|
|
329
|
+
info="Whether or not to use the archive",
|
|
330
|
+
type=bool,
|
|
331
|
+
optional=True,
|
|
332
|
+
default=None,
|
|
326
333
|
),
|
|
327
|
-
namebuild
|
|
328
|
-
info
|
|
329
|
-
optional
|
|
330
|
-
doc_visibility
|
|
334
|
+
namebuild=dict(
|
|
335
|
+
info="The object responsible for building filenames.",
|
|
336
|
+
optional=True,
|
|
337
|
+
doc_visibility=footprints.doc.visibility.ADVANCED,
|
|
331
338
|
),
|
|
332
|
-
expected
|
|
333
|
-
info
|
|
334
|
-
alias
|
|
335
|
-
type
|
|
336
|
-
optional
|
|
337
|
-
default
|
|
338
|
-
doc_zorder
|
|
339
|
+
expected=dict(
|
|
340
|
+
info="Is the resource expected ?",
|
|
341
|
+
alias=("promised",),
|
|
342
|
+
type=bool,
|
|
343
|
+
optional=True,
|
|
344
|
+
default=False,
|
|
345
|
+
doc_zorder=-5,
|
|
339
346
|
),
|
|
340
347
|
),
|
|
341
|
-
fastkeys
|
|
342
|
-
)
|
|
348
|
+
fastkeys={"block", "experiment"},
|
|
349
|
+
),
|
|
343
350
|
]
|
|
344
351
|
|
|
345
352
|
def __init__(self, *args, **kw):
|
|
346
|
-
logger.debug(
|
|
353
|
+
logger.debug("Vortex experiment provider init %s", self.__class__)
|
|
347
354
|
super().__init__(*args, **kw)
|
|
348
355
|
if self.namebuild is not None:
|
|
349
356
|
if self.namebuild not in self._CUSTOM_NAME_BUILDERS:
|
|
350
357
|
builder = fpx.vortexnamebuilder(name=self.namebuild)
|
|
351
358
|
if builder is None:
|
|
352
|
-
raise ValueError(
|
|
353
|
-
|
|
359
|
+
raise ValueError(
|
|
360
|
+
"The << {:s} >> name builder does not exists.".format(
|
|
361
|
+
self.namebuild
|
|
362
|
+
)
|
|
363
|
+
)
|
|
354
364
|
self._CUSTOM_NAME_BUILDERS[self.namebuild] = builder
|
|
355
365
|
self._namebuilder = self._CUSTOM_NAME_BUILDERS[self.namebuild]
|
|
356
366
|
else:
|
|
@@ -368,23 +378,26 @@ class Vortex(Provider):
|
|
|
368
378
|
# are specified, 'namespace' is ignored
|
|
369
379
|
if self.namespace and (self.cache or self.archive):
|
|
370
380
|
logger.warning(
|
|
371
|
-
f
|
|
381
|
+
f'Ignoring attribute "namespace" set to {self.namespace} '
|
|
372
382
|
"as attribute(s) cache and/or archive are specified"
|
|
373
383
|
)
|
|
374
|
-
if self.namespace and (
|
|
384
|
+
if self.namespace and (
|
|
385
|
+
(self.cache is None) and (self.archive is None)
|
|
386
|
+
):
|
|
375
387
|
warnings.warn(
|
|
376
|
-
|
|
377
|
-
|
|
388
|
+
'Using attribute "namespace" is deprecated, use "cache"'
|
|
389
|
+
'and/or "archive" instead.',
|
|
378
390
|
category=DeprecationWarning,
|
|
379
391
|
)
|
|
380
392
|
else:
|
|
381
393
|
self.namespace = set_namespace_from_cache_settings(
|
|
382
|
-
self.cache,
|
|
383
|
-
|
|
394
|
+
self.cache,
|
|
395
|
+
self.archive,
|
|
396
|
+
)
|
|
384
397
|
if not self.namespace:
|
|
385
398
|
raise ValueError(
|
|
386
|
-
|
|
387
|
-
|
|
399
|
+
'Attributes "cache" and "archive" cannot be '
|
|
400
|
+
'both specified as "False".'
|
|
388
401
|
)
|
|
389
402
|
|
|
390
403
|
@property
|
|
@@ -393,7 +406,7 @@ class Vortex(Provider):
|
|
|
393
406
|
|
|
394
407
|
@property
|
|
395
408
|
def realkind(self):
|
|
396
|
-
return
|
|
409
|
+
return "vortex"
|
|
397
410
|
|
|
398
411
|
def actual_experiment(self, resource):
|
|
399
412
|
return self.experiment
|
|
@@ -401,13 +414,15 @@ class Vortex(Provider):
|
|
|
401
414
|
def _str_more(self):
|
|
402
415
|
"""Additional information to print representation."""
|
|
403
416
|
try:
|
|
404
|
-
return
|
|
417
|
+
return "namespace='{:s}' block='{:s}'".format(
|
|
418
|
+
self.namespace, self.block
|
|
419
|
+
)
|
|
405
420
|
except AttributeError:
|
|
406
421
|
return super()._str_more()
|
|
407
422
|
|
|
408
423
|
def scheme(self, resource):
|
|
409
424
|
"""Default: ``vortex``."""
|
|
410
|
-
return
|
|
425
|
+
return "x" + self.realkind if self.expected else self.realkind
|
|
411
426
|
|
|
412
427
|
def netloc(self, resource):
|
|
413
428
|
"""Returns the current ``namespace``."""
|
|
@@ -450,16 +465,23 @@ class Vortex(Provider):
|
|
|
450
465
|
stackres, keepmember = resource.stackedstorage_resource()
|
|
451
466
|
if stackres:
|
|
452
467
|
stackpathinfo = self._pathname_info(stackres)
|
|
453
|
-
stackpathinfo[
|
|
468
|
+
stackpathinfo["block"] = "stacks"
|
|
454
469
|
if not keepmember:
|
|
455
|
-
stackpathinfo[
|
|
456
|
-
uqs[
|
|
457
|
-
|
|
458
|
-
|
|
470
|
+
stackpathinfo["member"] = None
|
|
471
|
+
uqs["stackpath"] = [
|
|
472
|
+
(
|
|
473
|
+
self.namebuilder.pack_pathname(stackpathinfo)
|
|
474
|
+
+ "/"
|
|
475
|
+
+ self.basename(stackres)
|
|
476
|
+
),
|
|
477
|
+
]
|
|
478
|
+
uqs["stackfmt"] = [
|
|
479
|
+
stackres.nativefmt,
|
|
480
|
+
]
|
|
459
481
|
return urlparse.urlencode(sorted(uqs.items()), doseq=True)
|
|
460
482
|
|
|
461
483
|
|
|
462
484
|
# Activate the footprint's fasttrack on the resources collector
|
|
463
|
-
fcollect = footprints.collectors.get(tag=
|
|
464
|
-
fcollect.fasttrack = (
|
|
485
|
+
fcollect = footprints.collectors.get(tag="provider")
|
|
486
|
+
fcollect.fasttrack = ("namespace",)
|
|
465
487
|
del fcollect
|