experimaestro 1.10.0__py3-none-any.whl → 1.15.2__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 (46) hide show
  1. experimaestro/core/arguments.py +10 -1
  2. experimaestro/core/identifier.py +11 -6
  3. experimaestro/core/objects/config.py +127 -193
  4. experimaestro/core/objects/config_walk.py +4 -6
  5. experimaestro/core/objects.pyi +2 -6
  6. experimaestro/core/serializers.py +1 -8
  7. experimaestro/launcherfinder/specs.py +8 -1
  8. experimaestro/run.py +2 -0
  9. experimaestro/server/data/0c35d18bf06992036b69.woff2 +0 -0
  10. experimaestro/server/data/1815e00441357e01619e.ttf +0 -0
  11. experimaestro/server/data/219aa9140e099e6c72ed.woff2 +0 -0
  12. experimaestro/server/data/2463b90d9a316e4e5294.woff2 +0 -0
  13. experimaestro/server/data/2582b0e4bcf85eceead0.ttf +0 -0
  14. experimaestro/server/data/3a4004a46a653d4b2166.woff +0 -0
  15. experimaestro/server/data/3baa5b8f3469222b822d.woff +0 -0
  16. experimaestro/server/data/4d73cb90e394b34b7670.woff +0 -0
  17. experimaestro/server/data/4ef4218c522f1eb6b5b1.woff2 +0 -0
  18. experimaestro/server/data/5d681e2edae8c60630db.woff +0 -0
  19. experimaestro/server/data/6f420cf17cc0d7676fad.woff2 +0 -0
  20. experimaestro/server/data/89999bdf5d835c012025.woff2 +0 -0
  21. experimaestro/server/data/914997e1bdfc990d0897.ttf +0 -0
  22. experimaestro/server/data/c210719e60948b211a12.woff2 +0 -0
  23. experimaestro/server/data/c380809fd3677d7d6903.woff2 +0 -0
  24. experimaestro/server/data/f882956fd323fd322f31.woff +0 -0
  25. experimaestro/server/data/favicon.ico +0 -0
  26. experimaestro/server/data/index.css +22963 -0
  27. experimaestro/server/data/index.css.map +1 -0
  28. experimaestro/server/data/index.html +27 -0
  29. experimaestro/server/data/index.js +101770 -0
  30. experimaestro/server/data/index.js.map +1 -0
  31. experimaestro/server/data/login.html +22 -0
  32. experimaestro/server/data/manifest.json +15 -0
  33. experimaestro/tests/tasks/all.py +7 -0
  34. experimaestro/tests/test_dependencies.py +0 -6
  35. experimaestro/tests/test_generators.py +93 -0
  36. experimaestro/tests/test_identifier.py +87 -76
  37. experimaestro/tests/test_instance.py +0 -12
  38. experimaestro/tests/test_serializers.py +0 -59
  39. experimaestro/tests/test_tasks.py +10 -23
  40. experimaestro/tests/test_types.py +2 -2
  41. experimaestro/utils/multiprocessing.py +44 -0
  42. {experimaestro-1.10.0.dist-info → experimaestro-1.15.2.dist-info}/METADATA +5 -4
  43. {experimaestro-1.10.0.dist-info → experimaestro-1.15.2.dist-info}/RECORD +46 -20
  44. {experimaestro-1.10.0.dist-info → experimaestro-1.15.2.dist-info}/WHEEL +1 -1
  45. {experimaestro-1.10.0.dist-info → experimaestro-1.15.2.dist-info}/entry_points.txt +0 -0
  46. {experimaestro-1.10.0.dist-info → experimaestro-1.15.2.dist-info/licenses}/LICENSE +0 -0
@@ -71,6 +71,7 @@ class ConfigWalk:
71
71
  return self.context.push(str(i))
72
72
 
73
73
  def map(self, k: str):
74
+ """Provides a path context when processing a tree"""
74
75
  return self.context.push(k)
75
76
 
76
77
  def stub(self, config):
@@ -108,11 +109,7 @@ class ConfigWalk:
108
109
  else:
109
110
  result[arg.name] = None
110
111
 
111
- # Deals with pre-tasks
112
- if info.pre_tasks:
113
- with self.map("__pre_tasks__"):
114
- self(info.pre_tasks)
115
-
112
+ # Deals with init tasks
116
113
  if info.init_tasks:
117
114
  with self.map("__init_tasks__"):
118
115
  self(info.init_tasks)
@@ -123,7 +120,8 @@ class ConfigWalk:
123
120
  and self.recurse_task
124
121
  and x.__xpm__.task is not x
125
122
  ):
126
- self(x.__xpm__.task)
123
+ with self.map("__task__"):
124
+ self(x.__xpm__.task)
127
125
 
128
126
  processed = self.postprocess(stub, x, result)
129
127
  self.visited[xid] = processed
@@ -168,7 +168,7 @@ class ConfigMixin:
168
168
  *,
169
169
  workspace: Incomplete | None = ...,
170
170
  launcher: Incomplete | None = ...,
171
- run_mode: RunMode = ...
171
+ run_mode: RunMode = ...,
172
172
  ): ...
173
173
  def stdout(self): ...
174
174
  def stderr(self): ...
@@ -195,11 +195,7 @@ class Config:
195
195
  def __post_init__(self) -> None: ...
196
196
  def __json__(self): ...
197
197
  def __identifier__(self) -> Identifier: ...
198
- def add_pretasks(self, *tasks: "LightweightTask"): ...
199
- def add_pretasks_from(self, configs: "Config"): ...
200
198
  def copy_dependencies(self, other: "Config"): ...
201
- @property
202
- def pre_tasks(self) -> List["LightweightTask"]: ...
203
199
 
204
200
  class LightweightTask(Config):
205
201
  def execute(self) -> None: ...
@@ -213,7 +209,7 @@ class Task(LightweightTask):
213
209
  workspace: Incomplete | None = ...,
214
210
  launcher: Incomplete | None = ...,
215
211
  run_mode: RunMode = ...,
216
- init_tasks: List["LightweightTask"] = []
212
+ init_tasks: List["LightweightTask"] = [],
217
213
  ): ...
218
214
  def task_outputs(self, dep: Callable[[Config], None]) -> Any: ...
219
215
 
@@ -1,10 +1,8 @@
1
- from typing import List, TypeVar, Callable, Any
2
- from pathlib import Path
1
+ from typing import List, TypeVar
3
2
  from experimaestro import Param
4
3
 
5
4
  from .objects import Config, LightweightTask
6
5
  from .arguments import DataPath
7
- from experimaestro import copyconfig
8
6
 
9
7
 
10
8
  class SerializationLWTask(LightweightTask):
@@ -39,8 +37,3 @@ class PathSerializationLWTask(SerializationLWTask):
39
37
 
40
38
  path: DataPath
41
39
  """Path containing the data"""
42
-
43
- @classmethod
44
- def construct(cls, value: T, path: Path, dep: Callable[[Config], Any]) -> T:
45
- value = copyconfig(value)
46
- return value.add_pretasks(dep(cls(value=value, path=path)))
@@ -29,7 +29,7 @@ class CudaSpecification:
29
29
  def __repr__(self):
30
30
  return (
31
31
  f"CUDA({self.model} "
32
- f"max={format_size(self.memory)}/min={format_size(self.min_memory)})"
32
+ f"max={format_size(self.memory, binary=True)}/min={format_size(self.min_memory, binary=True)})"
33
33
  )
34
34
 
35
35
 
@@ -47,6 +47,13 @@ class CPUSpecification:
47
47
  cpu_per_gpu: int = 0
48
48
  """Number of CPU per GPU (0 if not defined)"""
49
49
 
50
+ def __repr__(self):
51
+ return (
52
+ f"CPU("
53
+ f"mem={format_size(self.memory, binary=True)}, cores={self.cores}"
54
+ ")"
55
+ )
56
+
50
57
  def match(self, other: "CPUSpecification"):
51
58
  return (self.memory >= other.memory) and (self.cores >= other.cores)
52
59
 
experimaestro/run.py CHANGED
@@ -8,6 +8,7 @@ import json
8
8
  from typing import List
9
9
  import fasteners
10
10
  from experimaestro.notifications import progress, report_eoj
11
+ from experimaestro.utils.multiprocessing import delayed_shutdown
11
12
  from .core.types import ObjectType
12
13
  from experimaestro.utils import logger
13
14
  from experimaestro.core.objects import ConfigInformation
@@ -96,6 +97,7 @@ class TaskRunner:
96
97
  self.failedpath.write_text(str(code))
97
98
  self.cleanup()
98
99
  logger.info("Exiting")
100
+ delayed_shutdown(60, exit_code=code)
99
101
  sys.exit(1)
100
102
 
101
103
  def run(self):
Binary file