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.
Files changed (146) hide show
  1. vortex/__init__.py +135 -0
  2. vortex/algo/__init__.py +12 -0
  3. vortex/algo/components.py +2136 -0
  4. vortex/algo/mpitools.py +1648 -0
  5. vortex/algo/mpitools_templates/envelope_wrapper_default.tpl +27 -0
  6. vortex/algo/mpitools_templates/envelope_wrapper_mpiauto.tpl +29 -0
  7. vortex/algo/mpitools_templates/wrapstd_wrapper_default.tpl +18 -0
  8. vortex/algo/serversynctools.py +170 -0
  9. vortex/config.py +115 -0
  10. vortex/data/__init__.py +13 -0
  11. vortex/data/abstractstores.py +1572 -0
  12. vortex/data/containers.py +780 -0
  13. vortex/data/contents.py +596 -0
  14. vortex/data/executables.py +284 -0
  15. vortex/data/flow.py +113 -0
  16. vortex/data/geometries.ini +2689 -0
  17. vortex/data/geometries.py +703 -0
  18. vortex/data/handlers.py +1021 -0
  19. vortex/data/outflow.py +67 -0
  20. vortex/data/providers.py +465 -0
  21. vortex/data/resources.py +201 -0
  22. vortex/data/stores.py +1271 -0
  23. vortex/gloves.py +282 -0
  24. vortex/layout/__init__.py +27 -0
  25. vortex/layout/appconf.py +109 -0
  26. vortex/layout/contexts.py +511 -0
  27. vortex/layout/dataflow.py +1069 -0
  28. vortex/layout/jobs.py +1276 -0
  29. vortex/layout/monitor.py +833 -0
  30. vortex/layout/nodes.py +1424 -0
  31. vortex/layout/subjobs.py +464 -0
  32. vortex/nwp/__init__.py +11 -0
  33. vortex/nwp/algo/__init__.py +12 -0
  34. vortex/nwp/algo/assim.py +483 -0
  35. vortex/nwp/algo/clim.py +920 -0
  36. vortex/nwp/algo/coupling.py +609 -0
  37. vortex/nwp/algo/eda.py +632 -0
  38. vortex/nwp/algo/eps.py +613 -0
  39. vortex/nwp/algo/forecasts.py +745 -0
  40. vortex/nwp/algo/fpserver.py +927 -0
  41. vortex/nwp/algo/ifsnaming.py +403 -0
  42. vortex/nwp/algo/ifsroot.py +311 -0
  43. vortex/nwp/algo/monitoring.py +202 -0
  44. vortex/nwp/algo/mpitools.py +554 -0
  45. vortex/nwp/algo/odbtools.py +974 -0
  46. vortex/nwp/algo/oopsroot.py +735 -0
  47. vortex/nwp/algo/oopstests.py +186 -0
  48. vortex/nwp/algo/request.py +579 -0
  49. vortex/nwp/algo/stdpost.py +1285 -0
  50. vortex/nwp/data/__init__.py +12 -0
  51. vortex/nwp/data/assim.py +392 -0
  52. vortex/nwp/data/boundaries.py +261 -0
  53. vortex/nwp/data/climfiles.py +539 -0
  54. vortex/nwp/data/configfiles.py +149 -0
  55. vortex/nwp/data/consts.py +929 -0
  56. vortex/nwp/data/ctpini.py +133 -0
  57. vortex/nwp/data/diagnostics.py +181 -0
  58. vortex/nwp/data/eda.py +148 -0
  59. vortex/nwp/data/eps.py +383 -0
  60. vortex/nwp/data/executables.py +1039 -0
  61. vortex/nwp/data/fields.py +96 -0
  62. vortex/nwp/data/gridfiles.py +308 -0
  63. vortex/nwp/data/logs.py +551 -0
  64. vortex/nwp/data/modelstates.py +334 -0
  65. vortex/nwp/data/monitoring.py +220 -0
  66. vortex/nwp/data/namelists.py +644 -0
  67. vortex/nwp/data/obs.py +748 -0
  68. vortex/nwp/data/oopsexec.py +72 -0
  69. vortex/nwp/data/providers.py +182 -0
  70. vortex/nwp/data/query.py +217 -0
  71. vortex/nwp/data/stores.py +147 -0
  72. vortex/nwp/data/surfex.py +338 -0
  73. vortex/nwp/syntax/__init__.py +9 -0
  74. vortex/nwp/syntax/stdattrs.py +375 -0
  75. vortex/nwp/tools/__init__.py +10 -0
  76. vortex/nwp/tools/addons.py +35 -0
  77. vortex/nwp/tools/agt.py +55 -0
  78. vortex/nwp/tools/bdap.py +48 -0
  79. vortex/nwp/tools/bdcp.py +38 -0
  80. vortex/nwp/tools/bdm.py +21 -0
  81. vortex/nwp/tools/bdmp.py +49 -0
  82. vortex/nwp/tools/conftools.py +1311 -0
  83. vortex/nwp/tools/drhook.py +62 -0
  84. vortex/nwp/tools/grib.py +268 -0
  85. vortex/nwp/tools/gribdiff.py +99 -0
  86. vortex/nwp/tools/ifstools.py +163 -0
  87. vortex/nwp/tools/igastuff.py +249 -0
  88. vortex/nwp/tools/mars.py +56 -0
  89. vortex/nwp/tools/odb.py +548 -0
  90. vortex/nwp/tools/partitioning.py +234 -0
  91. vortex/nwp/tools/satrad.py +56 -0
  92. vortex/nwp/util/__init__.py +6 -0
  93. vortex/nwp/util/async.py +184 -0
  94. vortex/nwp/util/beacon.py +40 -0
  95. vortex/nwp/util/diffpygram.py +359 -0
  96. vortex/nwp/util/ens.py +198 -0
  97. vortex/nwp/util/hooks.py +128 -0
  98. vortex/nwp/util/taskdeco.py +81 -0
  99. vortex/nwp/util/usepygram.py +591 -0
  100. vortex/nwp/util/usetnt.py +87 -0
  101. vortex/proxy.py +6 -0
  102. vortex/sessions.py +341 -0
  103. vortex/syntax/__init__.py +9 -0
  104. vortex/syntax/stdattrs.py +628 -0
  105. vortex/syntax/stddeco.py +176 -0
  106. vortex/toolbox.py +982 -0
  107. vortex/tools/__init__.py +11 -0
  108. vortex/tools/actions.py +457 -0
  109. vortex/tools/addons.py +297 -0
  110. vortex/tools/arm.py +76 -0
  111. vortex/tools/compression.py +322 -0
  112. vortex/tools/date.py +20 -0
  113. vortex/tools/ddhpack.py +10 -0
  114. vortex/tools/delayedactions.py +672 -0
  115. vortex/tools/env.py +513 -0
  116. vortex/tools/folder.py +663 -0
  117. vortex/tools/grib.py +559 -0
  118. vortex/tools/lfi.py +746 -0
  119. vortex/tools/listings.py +354 -0
  120. vortex/tools/names.py +575 -0
  121. vortex/tools/net.py +1790 -0
  122. vortex/tools/odb.py +10 -0
  123. vortex/tools/parallelism.py +336 -0
  124. vortex/tools/prestaging.py +186 -0
  125. vortex/tools/rawfiles.py +10 -0
  126. vortex/tools/schedulers.py +413 -0
  127. vortex/tools/services.py +871 -0
  128. vortex/tools/storage.py +1061 -0
  129. vortex/tools/surfex.py +61 -0
  130. vortex/tools/systems.py +3396 -0
  131. vortex/tools/targets.py +384 -0
  132. vortex/util/__init__.py +9 -0
  133. vortex/util/config.py +1071 -0
  134. vortex/util/empty.py +24 -0
  135. vortex/util/helpers.py +184 -0
  136. vortex/util/introspection.py +63 -0
  137. vortex/util/iosponge.py +76 -0
  138. vortex/util/roles.py +51 -0
  139. vortex/util/storefunctions.py +103 -0
  140. vortex/util/structs.py +26 -0
  141. vortex/util/worker.py +150 -0
  142. vortex_nwp-2.0.0b1.dist-info/LICENSE +517 -0
  143. vortex_nwp-2.0.0b1.dist-info/METADATA +50 -0
  144. vortex_nwp-2.0.0b1.dist-info/RECORD +146 -0
  145. vortex_nwp-2.0.0b1.dist-info/WHEEL +5 -0
  146. vortex_nwp-2.0.0b1.dist-info/top_level.txt +1 -0
vortex/__init__.py ADDED
@@ -0,0 +1,135 @@
1
+ """
2
+ *Versatile Objects Rounded-up in a Toolbox for Environmental eXperiments*
3
+
4
+ VORTEX is a set of objects for basic resources handling in the context
5
+ of numerical weather prediction. Objects should be versatile enough to
6
+ be used either in an operational or research environment.
7
+
8
+ The user is provided with a standard interface for the description of
9
+ miscellaneaous resources (constants, climatological files, executable
10
+ models, etc.) with could be used as standalone objects or gathered inside
11
+ a logical layout defining the workflow of the experiment (configurations,
12
+ bunches, tasks, etc.).
13
+
14
+ Using the vortex modules implies the setting of a default session, as delivered
15
+ by the :mod:`vortex.sessions`. The current session could be changed and simultaneous
16
+ sessions could coexist.
17
+
18
+ Advanced users could access to specific classes of objects, but the use
19
+ of the very high level interface defined in the :mod:`vortex.toolbox` module is
20
+ strongly advised.
21
+ """
22
+
23
+ __version__ = '2.0.0b1'
24
+ __prompt__ = 'Vortex v-' + __version__ + ':'
25
+
26
+ __nextversion__ = '2.0.0b2'
27
+ __tocinfoline__ = 'VORTEX core package'
28
+
29
+ __all__ = [
30
+ "input", "output", "executable", "task", "promise", "diff",
31
+ ]
32
+
33
+ # Set vortex specific priorities for footprints usage
34
+
35
+ from bronx.fancies import loggers as bloggers
36
+
37
+ import footprints
38
+ footprints.priorities.set_before('debug', 'olive', 'oper')
39
+
40
+ # Set a root logging mechanism for vortex
41
+
42
+ #: Shortcut to Vortex's root logger
43
+ logger = bloggers.getLogger('vortex')
44
+
45
+ # Populate a fake proxy module with footprints shortcuts
46
+
47
+ from . import proxy
48
+ setup = footprints.config.get()
49
+ setup.add_proxy(proxy)
50
+ proxy.cat = footprints.proxy.cat
51
+ proxy.objects = footprints.proxy.objects
52
+
53
+ # Set a background environment and a root session
54
+
55
+ from . import tools
56
+ from . import sessions
57
+ from . import config
58
+
59
+ rootenv = tools.env.Environment(active=True)
60
+
61
+ rs = sessions.get(active=True, topenv=rootenv, glove=sessions.getglove(), prompt=__prompt__)
62
+ if rs.system().systems_reload():
63
+ rs.system(refill=True)
64
+ del rs
65
+
66
+ # Insert a dynamic callback so that any footprint resolution could check the current Glove
67
+
68
+
69
+ def vortexfpdefaults():
70
+ """Return actual glove, according to current environment."""
71
+ cur_session = sessions.current()
72
+ return dict(
73
+ glove=cur_session.glove,
74
+ systemtarget=cur_session.sh.default_target
75
+ )
76
+
77
+
78
+ footprints.setup.callback = vortexfpdefaults
79
+
80
+ # Shorthands to sessions components
81
+
82
+ ticket = sessions.get
83
+ sh = sessions.system
84
+
85
+ # Specific toolbox exceptions
86
+
87
+
88
+ class VortexForceComplete(Exception):
89
+ """Exception for handling fast exit mecanisms."""
90
+ pass
91
+
92
+ # If a config file can be found in current dir, load it
93
+ config.load_config()
94
+
95
+ # Load some superstars sub-packages
96
+ from .toolbox import (
97
+ input,
98
+ output,
99
+ executable,
100
+ promise,
101
+ diff,
102
+ defaults,
103
+ )
104
+ from .toolbox import algo as task
105
+ from . import nwp
106
+
107
+ # Now load plugins that have been installed with the
108
+ # 'vtx' entry point. Order matters: since plugins
109
+ # will typically depend on objects defined in 'vortex'
110
+ # and 'vortex.nwp', these must be imported /before/
111
+ # loading plugins.
112
+ from importlib.metadata import entry_points
113
+ for plugin in entry_points(group='vtx'):
114
+ plugin.load()
115
+ print(f"Loaded plugin {plugin.name}")
116
+
117
+ # Register proper vortex exit before the end of interpreter session
118
+
119
+ import bronx.stdtypes.date
120
+ def complete():
121
+ sessions.exit()
122
+ import multiprocessing
123
+ for kid in multiprocessing.active_children():
124
+ logger.warning('Terminate active kid %s', str(kid))
125
+ kid.terminate()
126
+ print('Vortex', __version__, 'completed', '(', bronx.stdtypes.date.at_second().reallynice(), ')')
127
+
128
+
129
+ import atexit
130
+ atexit.register(complete)
131
+ del atexit, complete
132
+
133
+ print('Vortex', __version__, 'loaded', '(', bronx.stdtypes.date.at_second().reallynice(), ')')
134
+
135
+ del footprints
@@ -0,0 +1,12 @@
1
+ """
2
+ Generic AlgoComponent classes (and related utility classes).
3
+
4
+ Application specific AlgoComponent classes should be defined in dedicated packages.
5
+ """
6
+
7
+ from . import components, serversynctools
8
+
9
+ #: No automatic export
10
+ __all__ = []
11
+
12
+ __tocinfoline__ = 'Generic AlgoComponent classes (and their utility classes)'