experimaestro 0.22.0__py2.py3-none-any.whl → 0.24.0__py2.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.

Potentially problematic release.


This version of experimaestro might be problematic. Click here for more details.

@@ -1,13 +1,11 @@
1
1
  # Test that progress notification work
2
2
  from copy import copy
3
- import logging
4
3
  from pathlib import Path
5
4
  import time
6
5
  import fasteners
7
6
  from typing import List, Tuple, Union
8
- from experimaestro.commandline import CommandLineJob
9
7
  from experimaestro import Task, Annotated, pathgenerator, progress, tqdm
10
- from experimaestro.core.objects import TaskOutput, logger
8
+ from experimaestro.core.objects import ConfigWrapper, logger
11
9
  from experimaestro.notifications import LevelInformation
12
10
  from experimaestro.scheduler import Job, Listener
13
11
  from queue import Queue
@@ -74,7 +72,7 @@ def test_progress_basic():
74
72
  listener = ProgressListener()
75
73
  xp.scheduler.addlistener(listener)
76
74
 
77
- out = ProgressingTask().submit() # type: TaskOutput
75
+ out: ConfigWrapper = ProgressingTask().submit()
78
76
  path = out.path # type: Path
79
77
  job = out.__xpm__.job
80
78
 
@@ -87,9 +85,9 @@ def test_progress_basic():
87
85
  for v in progresses:
88
86
  writeprogress(path, v)
89
87
  if v < 1:
90
- l = listener.progresses.get()[0]
91
- logger.info("Got %s", l)
92
- assert l.progress == v
88
+ info = listener.progresses.get()[0]
89
+ logger.info("Got %s", info)
90
+ assert info.progress == v
93
91
 
94
92
 
95
93
  def test_progress_multiple():
@@ -105,7 +103,7 @@ def test_progress_multiple():
105
103
  listener1 = ProgressListener()
106
104
  xp1.scheduler.addlistener(listener1)
107
105
 
108
- out = ProgressingTask().submit() # type: TaskOutput
106
+ out = ProgressingTask().submit() # type: ConfigWrapper
109
107
  path = out.path # type: Path
110
108
  job = out.__xpm__.job
111
109
 
@@ -219,7 +217,7 @@ def test_progress_nested():
219
217
  listener = ProgressListener()
220
218
  xp.scheduler.addlistener(listener)
221
219
 
222
- out = NestedProgressingTask().submit() # type: TaskOutput
220
+ out = NestedProgressingTask().submit() # type: ConfigWrapper
223
221
  job = out.__xpm__.job
224
222
  path = out.path # type: Path
225
223
 
@@ -0,0 +1,54 @@
1
+ from experimaestro import Config, Task, Param, PathBasedSerializedConfig, copyconfig
2
+ from experimaestro.tests.utils import TemporaryExperiment
3
+
4
+
5
+ class SubModel(Config):
6
+ pass
7
+
8
+
9
+ class Model(Config):
10
+ submodel: Param[SubModel]
11
+
12
+ def __post_init__(self):
13
+ self.initialized = False
14
+ self.submodel.initialized = False
15
+
16
+
17
+ class SerializedModel(PathBasedSerializedConfig):
18
+ def initialize(self):
19
+ self.config.initialized = True
20
+ self.config.submodel.initialized = True
21
+
22
+
23
+ class Trainer(Task):
24
+ model: Param[Config]
25
+
26
+ def taskoutputs(self):
27
+ return SerializedModel(config=copyconfig(self.model))
28
+
29
+ def execute(self):
30
+ assert not self.model.initialized, "Model not initialized"
31
+
32
+
33
+ class Evaluate(Task):
34
+ model: Param[Config]
35
+ is_submodel: Param[bool] = False
36
+
37
+ def execute(self):
38
+ assert self.model.initialized, "Model not initialized"
39
+ if self.is_submodel:
40
+ assert isinstance(self.model, SubModel)
41
+ else:
42
+ assert isinstance(self.model, Model)
43
+
44
+
45
+ def test_serializers_xp():
46
+ with TemporaryExperiment("serializers", maxwait=10, port=0):
47
+ model = Model(submodel=SubModel())
48
+ trained_model: Model = Trainer(model=model).submit()
49
+
50
+ # Use the model itself
51
+ Evaluate(model=trained_model).submit()
52
+
53
+ # Use a submodel
54
+ Evaluate(model=trained_model.submodel, is_submodel=True).submit()
@@ -1,12 +1,12 @@
1
1
  import time
2
2
  from experimaestro.scheduler import JobState
3
- from experimaestro.core.objects import TaskOutput
3
+ from experimaestro.core.objects import ConfigWrapper
4
4
  from experimaestro.scheduler import Listener
5
5
  from threading import Condition
6
6
  from tqdm.autonotebook import tqdm
7
7
 
8
8
 
9
- def jobmonitor(*outputs: TaskOutput):
9
+ def jobmonitor(*outputs: ConfigWrapper):
10
10
  """Follow the progress of a list of jobs (in order)"""
11
11
 
12
12
  cv = Condition()
experimaestro/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # file generated by setuptools_scm
2
2
  # don't change, don't track in version control
3
- __version__ = version = '0.22.0'
4
- __version_tuple__ = version_tuple = (0, 22, 0)
3
+ __version__ = version = '0.24.0'
4
+ __version_tuple__ = version_tuple = (0, 24, 0)
experimaestro/xpmutils.py CHANGED
@@ -1,10 +1,10 @@
1
1
  """Utilities exposed to users of the experimaestro API"""
2
2
 
3
3
  from pathlib import Path
4
- from experimaestro.core.objects import GenerationContext
4
+ from experimaestro.core.objects import ConfigWalkContext
5
5
 
6
6
 
7
- class DirectoryContext(GenerationContext):
7
+ class DirectoryContext(ConfigWalkContext):
8
8
  """Special generation context used for debugging and testing"""
9
9
 
10
10
  def __init__(self, path: Path):
@@ -16,7 +16,7 @@ class DirectoryContext(GenerationContext):
16
16
  return self._path
17
17
 
18
18
 
19
- class EmptyContext(GenerationContext):
19
+ class EmptyContext(ConfigWalkContext):
20
20
  """Special generation context used for debugging and testing"""
21
21
 
22
22
  @property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: experimaestro
3
- Version: 0.22.0
3
+ Version: 0.24.0
4
4
  Summary: "Experimaestro is a computer science experiment manager"
5
5
  Home-page: https://github.com/experimaestro/experimaestro-python
6
6
  Author: Benjamin Piwowarski
@@ -32,15 +32,17 @@ Requires-Dist: sortedcontainers
32
32
  Requires-Dist: pyparsing
33
33
  Requires-Dist: humanfriendly
34
34
  Requires-Dist: huggingface-hub (~=0.11.1)
35
- Requires-Dist: eventlet
35
+ Requires-Dist: gevent
36
+ Requires-Dist: gevent-websocket
36
37
  Requires-Dist: flask
37
38
  Requires-Dist: flask-socketio
38
39
  Requires-Dist: Arpeggio (>=2.0)
39
40
  Requires-Dist: watchdog (>2.0.0)
40
41
  Requires-Dist: marshmallow
41
42
  Requires-Dist: fabric
43
+ Requires-Dist: decorator
42
44
  Requires-Dist: rpyc
43
- Requires-Dist: typing-extensions (>=3.7.4.3) ; python_version < "3.9"
45
+ Requires-Dist: typing-extensions (>=4.2) ; python_version < "3.11"
44
46
  Requires-Dist: cached-property ; python_version < "3.9"
45
47
  Provides-Extra: dev
46
48
  Requires-Dist: docutils ; extra == 'dev'
@@ -155,6 +157,27 @@ if __name__ == "__main__":
155
157
 
156
158
  which can be launched with `python test.py /tmp/helloworld-workdir`
157
159
 
160
+ ## 0.24.0 (2023-05-23)
161
+
162
+ ### Feat
163
+
164
+ - serialized configurations
165
+
166
+ ### Fix
167
+
168
+ - requirement for fabric
169
+ - add gevent-websocket for supporting websockets
170
+
171
+ ### Refactor
172
+
173
+ - Changed TaskOutput to ConfigWrapper
174
+
175
+ ## 0.23.0 (2023-04-07)
176
+
177
+ ### Feat
178
+
179
+ - submit hooks to allow e.g. changing the environment variables
180
+
158
181
  ## 0.22.0 (2023-04-05)
159
182
 
160
183
  ### Feat
@@ -1,13 +1,13 @@
1
- experimaestro/__init__.py,sha256=kaK8hWjIxRexeEQ27L5cReExgG2tgvZjvaOFrHMJEg4,1294
2
- experimaestro/__main__.py,sha256=A_hT19SXNCOIRaW27sfFMwT0fdvgglQo2jPFJQQQwYM,11192
1
+ experimaestro/__init__.py,sha256=QJipxUiZN_zgzcl1gf3lK67MCWj_-uHJbc6t_LqAIbA,1502
2
+ experimaestro/__main__.py,sha256=wLQ3GUriDiNL2tWWQ1lLbxHrl79OK95we9UH307rSB8,11198
3
3
  experimaestro/annotations.py,sha256=laaAy2C57SJTPeRuD0B5jRUN0TgZYckO3fjBIR9laCs,8603
4
4
  experimaestro/checkers.py,sha256=ZCMbnE_GFC5compWjt-fuHhPImi9fCPjImF8Ow9NqK8,696
5
5
  experimaestro/click.py,sha256=HTfjm4poqfG69MIYztrPWEei5OVnd154UCr2pJm6yp8,2390
6
- experimaestro/commandline.py,sha256=YUpAb_z65fSMs0TToNig2xLObfI-OFu2c95iLAbAXmA,9677
6
+ experimaestro/commandline.py,sha256=NS1ubme8DTJtDS2uWwdHLQiZsl6TSK1LkNxu39c3-cw,9463
7
7
  experimaestro/compat.py,sha256=dQqE2ZNHLM2wtdfp7fBRYMfC33qNehVf9J6FGRBUQhs,171
8
8
  experimaestro/filter.py,sha256=Qp8ObI3fBGYJjNo2TMu7N3d1rVTdYXP9PVBLFg5JUHk,5775
9
- experimaestro/generators.py,sha256=AUXaGA5Hvl-agkxybkJ8dQtFGW0yIJzuC3X8WU_Gf2g,1235
10
- experimaestro/huggingface.py,sha256=2f0MqNxfth90R7kO6VVJ3K5tXdx95w2d1ljggrL6l_E,3056
9
+ experimaestro/generators.py,sha256=9NQ_TfDfASkArLnO4PF7s5Yoo9KWjlna2DCPzk5gJOI,1230
10
+ experimaestro/huggingface.py,sha256=HBgQFa544TyudhWo1bxCO_AuR2wHlmUT7Xhvu7q1Y5I,3062
11
11
  experimaestro/ipc.py,sha256=0sVzK8mZ4VCRQ5L3piCqTm1o-AVfTfJEXW26P6SOFrY,1694
12
12
  experimaestro/locking.py,sha256=hPT-LuDGZTijpbme8O0kEoB9a3WjdVzI2h31OT44UxE,1477
13
13
  experimaestro/mypy.py,sha256=M39VFuDrab-ymlCDIF5jys9oKpTwnuBPzb1T8Un5J3s,285
@@ -19,23 +19,24 @@ experimaestro/settings.py,sha256=E6nFyrUB6uBYQlQARczr_YKUn06zRoZ_RbPgDj6jHaU,914
19
19
  experimaestro/taskglobals.py,sha256=aBjPpo4HQp6E6M3GQ8L6PR4rK2Lu0kD5dS1WjnaGgDc,499
20
20
  experimaestro/tokens.py,sha256=aHT6lN4YLF0ujXl0nNu1sSSx-2ebrYiZFfrFvvmsQ1s,14681
21
21
  experimaestro/typingutils.py,sha256=gkEhJ9Fir05xh5v45pYKmrGYiLCykGtlU8sL-ydFXS8,1785
22
- experimaestro/version.py,sha256=sm9RIoEcmkvSrNOjZY--ysY4sf77dk0DEKPYtk1caog,162
23
- experimaestro/xpmutils.py,sha256=E3Q9ZMMi2L30J-KxHE0nzt-pbW9Nehu6Fxy_-7qdln0,638
22
+ experimaestro/version.py,sha256=ZVPm3jk9go-IY_2KTuk6z9VsibssyAAJYCsrpb1eX2w,162
23
+ experimaestro/xpmutils.py,sha256=S21eMbDYsHfvmZ1HmKpq5Pz5O-1HnCLYxKbyTBbASyQ,638
24
24
  experimaestro/connectors/__init__.py,sha256=hxcBSeVLk_7oyiIlS3l-9dGg1NGtShwvRD1tS7f8D2M,5461
25
25
  experimaestro/connectors/local.py,sha256=w4IN_pxiPh9jb5u4yIH569ZbVHb6i2LfGhdsGFQ625o,5760
26
26
  experimaestro/connectors/ssh.py,sha256=rQv_j3yQ5g-HyX4tvO_E0qD6xkrZyTq5oRYQEC1WhYU,8206
27
27
  experimaestro/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  experimaestro/core/arguments.py,sha256=KzvPfO92deWsgjhrPULjFuNpr8aCDMbLhCoz5xafrtg,5824
29
29
  experimaestro/core/context.py,sha256=70ZhDBobGDl0wEyvZyqyrnWagLs7EiRf0cBSXp1N3Lc,2479
30
- experimaestro/core/objects.py,sha256=p6Ojws0GZByxlYYCcvPUacMiJWYYzyvlxFUuQPNf6t4,55390
31
- experimaestro/core/objects.pyi,sha256=EUXDaIuj5_V3zZPU6ODsw5hZ4d4B4MbNYNnAv2x9-3E,7753
32
- experimaestro/core/types.py,sha256=M3XvJNnRFgquLgbogB8zCnInWeapig_yYzrCbizRaKw,17972
30
+ experimaestro/core/objects.py,sha256=SoFKiqOTxQE2zMrlLAsHUBQQ_4nhTKfIPQ9TUD083Rc,57211
31
+ experimaestro/core/objects.pyi,sha256=yo_-tJpHbv-7m56Jr706Zpgtt6rGpEEEfZwer2AgLiw,7885
32
+ experimaestro/core/serializers.py,sha256=xmgdkCJVDTlhsHIHMZ8gxf0cyqAWu_wCZTZFOyht_Dc,1187
33
+ experimaestro/core/types.py,sha256=f8y-N0hKsqxgX_l__Vh5xIh4tudw2Ws2RkECHB3Ki44,19099
33
34
  experimaestro/launcherfinder/__init__.py,sha256=sM9U0dDvUkyRIEv5QnU9XZCn5uJ6Q6x4OAbWPmN9qcs,148
34
35
  experimaestro/launcherfinder/base.py,sha256=NptPJ0e8CktdhOPejocSfI_B4mloeH_EmJrbXruUCSA,1020
35
36
  experimaestro/launcherfinder/parser.py,sha256=0qDXgdPce_PsWDy-hKTfxxjXjTAu4FA8moKtyllB2-Q,2129
36
37
  experimaestro/launcherfinder/registry.py,sha256=Ng50ONPcu-BKtxN5z6rjSg7FPHMVva3wekdKvRSam4U,7363
37
38
  experimaestro/launcherfinder/specs.py,sha256=xedeGt-Qgz9X2A5zaVWborsUsFp2XSTmRK6pJIMrJ9A,5359
38
- experimaestro/launchers/__init__.py,sha256=ahVRwtBS7uFlkNC1JQ6xHnx0C18ZeJ21J7Imx9i2Hec,2305
39
+ experimaestro/launchers/__init__.py,sha256=lXn544sgJExr6uirILWzAXu_IfmfyqFZOt4OzRnjHXg,2525
39
40
  experimaestro/launchers/direct.py,sha256=jxvlBLp-s1NiZ91kNUzGfnkdkHAwsrDZYPBDu_rX6dU,1883
40
41
  experimaestro/launchers/oar.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
42
  experimaestro/launchers/slurm.py,sha256=50c0K_yuLUmFAkl1KH755yDKYvc0aIha1jOQY38IcwI,24121
@@ -45,12 +46,12 @@ experimaestro/mkdocs/base.py,sha256=SwLh9s7BZfrTAZdBaealSqVeLAroDSwLLMOHmLCxMPQ,
45
46
  experimaestro/mkdocs/metaloader.py,sha256=qCqnTWhlgxql-oe46E8AbvYdoM311-lQh-msmPnbllQ,1481
46
47
  experimaestro/mkdocs/style.css,sha256=42kJ6Ozq_n4Iw5UfJ4-nO1u-HN3ELvV7Vhvj1Xkn7rQ,66
47
48
  experimaestro/scheduler/__init__.py,sha256=ERmmOxz_9mUkIuccNbzUa5Y6gVLLVDdyc4cCxbCCUbY,20
48
- experimaestro/scheduler/base.py,sha256=vq8lxD3E5CmhZGYNncTrmiu1RWx8x0lMR3LjKz-agY4,29136
49
+ experimaestro/scheduler/base.py,sha256=ZFHIEabBfunuSqQN4lffs8VcJCG07MImyFaKLYc3MKo,29588
49
50
  experimaestro/scheduler/dependencies.py,sha256=n9XegwrmjayOIxt3xhuTEBVEBGSq4oeVdzz-FviDGXo,1994
50
51
  experimaestro/scheduler/environment.py,sha256=ZaSHSgAcZBmIj7b_eS1OvNQOuVLFvuw-qvqtYrc3Vms,2393
51
52
  experimaestro/scheduler/services.py,sha256=lrxhM4feQuGjtBVHJbEdmzI9x-bPBa5rXVcaDjjiSqU,1820
52
53
  experimaestro/scheduler/workspace.py,sha256=xATJi6-GJcpdwB4alliJnmAuvwt-URUiUKUfq5scUac,1731
53
- experimaestro/server/__init__.py,sha256=AF0zy5caEUqSkRxQrRcaAoioGx_qhY-kGgqOuRVGca0,10135
54
+ experimaestro/server/__init__.py,sha256=0Dy3cdpaBOun7VwNvXwHmGdR13Hc4DQBDQyQsF45430,10420
54
55
  experimaestro/sphinx/__init__.py,sha256=heovvtwbYToZM-b6HNi4pJdBoo_97usdEawhMGSK3bk,9560
55
56
  experimaestro/sphinx/static/experimaestro.css,sha256=0rEgt1LoDdD-a_R5rVfWZ19zD1gR-1L7q3f4UibIB58,294
56
57
  experimaestro/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -62,13 +63,13 @@ experimaestro/tests/task_tokens.py,sha256=vgqUa-S_YC2Id9pGOSv40qFTwq1WGZkFhr556Z
62
63
  experimaestro/tests/test_checkers.py,sha256=SJ6E60Df6mpXdRvrjIAOVsJpfUgk6O9toOh6gIVc-8k,409
63
64
  experimaestro/tests/test_findlauncher.py,sha256=yvp1YoYIfLnt8D2mLTYvM6mzd4iDrETpBudMRtsz_ls,2938
64
65
  experimaestro/tests/test_forward.py,sha256=oxhEnH_ovOjxXNH7-Gvqw2IFaJqoFBBCGF_OLjPh488,810
65
- experimaestro/tests/test_identifier.py,sha256=xg0AgPqim1hq9nAvODROP9Vv7atLL1DFAKXbcEsjp4k,10488
66
- experimaestro/tests/test_instance.py,sha256=m_4AdxKfa5Zzgn3w6_AOhT9wGrHEhZdDt1BmCEOtY6M,1355
66
+ experimaestro/tests/test_identifier.py,sha256=fsW1YrXrkgHqkDh1wfu0MuY-MbLuUpRT3ro76GH_Lr8,11055
67
+ experimaestro/tests/test_instance.py,sha256=gW8itFn-YRN5r2VU9Dq7FlOMcEMAXAR4lJ8XHMEg5Vk,1494
67
68
  experimaestro/tests/test_objects.py,sha256=kotxkhZXI05q6uCX_IvNh0QVXcNXdAR6GIVzx4A47xk,1191
68
- experimaestro/tests/test_outputs.py,sha256=UrO_QB50lDkVH2gNBco31kCRdga1bpX79sLqE_22hco,2028
69
+ experimaestro/tests/test_outputs.py,sha256=FtAQ0f5Nyg0MVwPrI6_2mcP478NscsGZV6tN4xpxQyk,870
69
70
  experimaestro/tests/test_param.py,sha256=ONEydx4bFZKOijf86s30S2WuCsfOG9-rBY4gAWiJ7W8,6781
70
- experimaestro/tests/test_progress.py,sha256=ZrDHtlEhXcLUYOK3Zn8rNkhWwUXvYs42SVeMTHW1xco,7711
71
- experimaestro/tests/test_serialization.py,sha256=U1YlaWjxCFO86VOkfKplOtIr0ZHOUJOy9jfoLGLm2qM,1132
71
+ experimaestro/tests/test_progress.py,sha256=wELD8Qj8b7J2d5KYU8k2wzSmHMMn2o67rXDc_iDx3-A,7656
72
+ experimaestro/tests/test_serializers.py,sha256=5bWSRL99keY8qCYwr_orLEf2T24qGRRjDI1TJFjBKlo,1424
72
73
  experimaestro/tests/test_snippets.py,sha256=Q_SrQ5GJ3v5SN-gtLSlgqxykONSS0eW9vk4R4TsnpIg,3073
73
74
  experimaestro/tests/test_ssh.py,sha256=JhwsS4lJWQeMhtnDfJhQqJ5dwEThqvcNBBgUq1EWvk0,979
74
75
  experimaestro/tests/test_tags.py,sha256=cs69ENFEnlkBX_LErql4OCY5JFPCLILkia8Gntqlh18,2669
@@ -101,14 +102,14 @@ experimaestro/tools/diff.py,sha256=VZwoq_kzO8znuckxACrWRyWiRQnOJnNvFXt9_nycAxw,3
101
102
  experimaestro/tools/jobs.py,sha256=63bXhJ7RGdczLU_nxu2skGn-9dwgr4r5pD23qH4WeBA,3516
102
103
  experimaestro/utils/__init__.py,sha256=BdYguxAbR1jOQPV36OgGA31itaMvBJ6WVPV6b4Jn4xw,2434
103
104
  experimaestro/utils/asyncio.py,sha256=zEQQqZW6uHGnFknp_udt9WjjtqLNNMWun9TPL6FOF64,601
104
- experimaestro/utils/jobs.py,sha256=srnme_mrUl2jdokqRBZM7wWFQH_aq61ceEpiJMRxix8,2450
105
+ experimaestro/utils/jobs.py,sha256=664eh22X_BWXoJWfIFT9rtRjM9QbOJhKkN5CyWs6H-4,2456
105
106
  experimaestro/utils/jupyter.py,sha256=JcEo2yQK7x3Cr1tNl5FqGMZOICxCv9DwMvL5xsWdQPk,2183
106
107
  experimaestro/utils/resources.py,sha256=gDjkrRjo7GULWyXmNXm_u1uqzEIAoAvJydICk56nOQw,1006
107
108
  experimaestro/utils/settings.py,sha256=jpFMqF0DLL4_P1xGal0zVR5cOrdD8O0Y2IOYvnRgN3k,793
108
109
  experimaestro/utils/yaml.py,sha256=jEjqXqUtJ333wNUdIc0o3LGvdsTQ9AKW9a9CCd-bmGU,6766
109
- experimaestro-0.22.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
110
- experimaestro-0.22.0.dist-info/METADATA,sha256=cv_KTbAUynHNfBWfmBW3553Qd1ynovAcryGIyGH7-B0,6381
111
- experimaestro-0.22.0.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
112
- experimaestro-0.22.0.dist-info/entry_points.txt,sha256=VsHkdvdBt9feNcnofvFyNbEDNjKU3BTSVPJcAGWNgko,591
113
- experimaestro-0.22.0.dist-info/top_level.txt,sha256=siYS2iOls_-f2iUoulKaaXuQQHroIDN36S8YAI1CFZk,14
114
- experimaestro-0.22.0.dist-info/RECORD,,
110
+ experimaestro-0.24.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
111
+ experimaestro-0.24.0.dist-info/METADATA,sha256=iJuR6W-vAanMpQMFk2I9sNuk1zkbQdsGIJH-iOBCEeQ,6732
112
+ experimaestro-0.24.0.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
113
+ experimaestro-0.24.0.dist-info/entry_points.txt,sha256=VsHkdvdBt9feNcnofvFyNbEDNjKU3BTSVPJcAGWNgko,591
114
+ experimaestro-0.24.0.dist-info/top_level.txt,sha256=siYS2iOls_-f2iUoulKaaXuQQHroIDN36S8YAI1CFZk,14
115
+ experimaestro-0.24.0.dist-info/RECORD,,
@@ -1,45 +0,0 @@
1
- # Test post-experimental serialization
2
-
3
- from pathlib import Path
4
- from experimaestro import Config, DataPath, Task, Param
5
- from experimaestro.core.objects import ConfigInformation
6
- from experimaestro.scheduler.workspace import RunMode
7
-
8
-
9
- class A(Config):
10
- path: DataPath[Path]
11
-
12
-
13
- class TaskA(Task):
14
- id: Param[str]
15
-
16
- def taskoutputs(self):
17
- return A()
18
-
19
-
20
- def test_serialization_simple(tmp_path_factory):
21
- dir = tmp_path_factory.mktemp("ser")
22
-
23
- a = A(path=Path(__file__))
24
- a.__xpm__.serialize(dir)
25
-
26
- des_a = ConfigInformation.deserialize(dir)
27
- assert des_a.path != Path(__file__)
28
- assert des_a.path.read_text() == Path(__file__).read_text()
29
-
30
-
31
- def test_serialization_identifier(tmp_path_factory):
32
- dir = tmp_path_factory.mktemp("ser")
33
-
34
- a = TaskA(id="id").submit(run_mode=RunMode.DRY_RUN)
35
- a = a.__unwrap__()
36
- a.__xpm__.serialize(dir)
37
-
38
- des_a = ConfigInformation.deserialize(dir)
39
-
40
- des_a_id = des_a.__identifier__()
41
-
42
- assert des_a_id.all == a.__identifier__().all, (
43
- "Identifier don't match: "
44
- f"expected {a.__identifier__().all.hex()}, got {des_a_id.all.hex()}"
45
- )