experimaestro 0.23.0__zip → 0.24.0__zip

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.

Files changed (189) hide show
  1. {experimaestro-0.23.0 → experimaestro-0.24.0}/CHANGELOG.md +15 -0
  2. {experimaestro-0.23.0 → experimaestro-0.24.0}/PKG-INFO +16 -1
  3. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/experiments/task.md +45 -7
  4. {experimaestro-0.23.0 → experimaestro-0.24.0}/pyproject.toml +1 -1
  5. {experimaestro-0.23.0 → experimaestro-0.24.0}/requirements.txt +3 -0
  6. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/__init__.py +3 -3
  7. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/__main__.py +2 -2
  8. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/objects.py +167 -129
  9. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/objects.pyi +2 -1
  10. experimaestro-0.24.0/src/experimaestro/core/serializers.py +52 -0
  11. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/huggingface.py +2 -2
  12. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_identifier.py +33 -6
  13. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_instance.py +18 -15
  14. experimaestro-0.24.0/src/experimaestro/tests/test_outputs.py +50 -0
  15. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_progress.py +7 -9
  16. experimaestro-0.24.0/src/experimaestro/tests/test_serializers.py +54 -0
  17. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/jobs.py +2 -2
  18. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/version.py +2 -2
  19. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/PKG-INFO +16 -1
  20. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/SOURCES.txt +2 -1
  21. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/requires.txt +2 -0
  22. experimaestro-0.23.0/src/experimaestro/tests/test_outputs.py +0 -88
  23. experimaestro-0.23.0/src/experimaestro/tests/test_serialization.py +0 -45
  24. {experimaestro-0.23.0 → experimaestro-0.24.0}/.circleci/config.yml +0 -0
  25. {experimaestro-0.23.0 → experimaestro-0.24.0}/.flake8 +0 -0
  26. {experimaestro-0.23.0 → experimaestro-0.24.0}/.github/release.yaml +0 -0
  27. {experimaestro-0.23.0 → experimaestro-0.24.0}/.github/workflows/pytest.yml +0 -0
  28. {experimaestro-0.23.0 → experimaestro-0.24.0}/.github/workflows/python-publish.yml +0 -0
  29. {experimaestro-0.23.0 → experimaestro-0.24.0}/.gitignore +0 -0
  30. {experimaestro-0.23.0 → experimaestro-0.24.0}/.gitmodules +0 -0
  31. {experimaestro-0.23.0 → experimaestro-0.24.0}/.pre-commit-config.yaml +0 -0
  32. {experimaestro-0.23.0 → experimaestro-0.24.0}/.prettierignore +0 -0
  33. {experimaestro-0.23.0 → experimaestro-0.24.0}/.readthedocs.yml +0 -0
  34. {experimaestro-0.23.0 → experimaestro-0.24.0}/LICENSE +0 -0
  35. {experimaestro-0.23.0 → experimaestro-0.24.0}/MANIFEST.in +0 -0
  36. {experimaestro-0.23.0 → experimaestro-0.24.0}/README.md +0 -0
  37. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/.gitignore +0 -0
  38. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/.nolluprc.js +0 -0
  39. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/CHANGELOG.md +0 -0
  40. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/README.md +0 -0
  41. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/package-lock.json +0 -0
  42. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/package.json +0 -0
  43. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/postcss.config.js +0 -0
  44. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/public/favicon.ico +0 -0
  45. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/public/index.html +0 -0
  46. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/public/login.html +0 -0
  47. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/public/manifest.json +0 -0
  48. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/App.tsx +0 -0
  49. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/Experiments.tsx +0 -0
  50. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/Services.tsx +0 -0
  51. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/TaskDetail.tsx +0 -0
  52. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/TaskJobs.tsx +0 -0
  53. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/Tasks.tsx +0 -0
  54. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/client.ts +0 -0
  55. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/clipboard.ts +0 -0
  56. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/index.css +0 -0
  57. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/index.tsx +0 -0
  58. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/logo.png +0 -0
  59. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/logo.pxm +0 -0
  60. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/reducers.ts +0 -0
  61. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/store.ts +0 -0
  62. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/theme/_jobs.scss +0 -0
  63. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/theme/theme.scss +0 -0
  64. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/ui/messages.tsx +0 -0
  65. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/tsconfig.json +0 -0
  66. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/webpack.config.ts +0 -0
  67. {experimaestro-0.23.0 → experimaestro-0.24.0}/app/xp/run.py +0 -0
  68. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/changelog.md +0 -0
  69. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/cli.md +0 -0
  70. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/concepts.md +0 -0
  71. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/configuration.md +0 -0
  72. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/connectors/index.md +0 -0
  73. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/documenting.md +0 -0
  74. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/experiments/config.md +0 -0
  75. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/experiments/overview.md +0 -0
  76. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/experiments/plan.md +0 -0
  77. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/faq.md +0 -0
  78. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/index.md +0 -0
  79. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/jupyter.md +0 -0
  80. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/launchers/index.md +0 -0
  81. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/requirements.txt +0 -0
  82. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/serialization.md +0 -0
  83. {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/tutorial.md +0 -0
  84. {experimaestro-0.23.0 → experimaestro-0.24.0}/mkdocs.yml +0 -0
  85. {experimaestro-0.23.0 → experimaestro-0.24.0}/pytest.ini +0 -0
  86. {experimaestro-0.23.0 → experimaestro-0.24.0}/scripts/longtask.py +0 -0
  87. {experimaestro-0.23.0 → experimaestro-0.24.0}/setup.cfg +0 -0
  88. {experimaestro-0.23.0 → experimaestro-0.24.0}/setup.py +0 -0
  89. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/annotations.py +0 -0
  90. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/checkers.py +0 -0
  91. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/click.py +0 -0
  92. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/commandline.py +0 -0
  93. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/compat.py +0 -0
  94. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/connectors/__init__.py +0 -0
  95. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/connectors/local.py +0 -0
  96. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/connectors/ssh.py +0 -0
  97. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/__init__.py +0 -0
  98. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/arguments.py +0 -0
  99. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/context.py +0 -0
  100. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/types.py +0 -0
  101. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/filter.py +0 -0
  102. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/generators.py +0 -0
  103. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/ipc.py +0 -0
  104. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launcherfinder/__init__.py +0 -0
  105. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launcherfinder/base.py +0 -0
  106. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launcherfinder/parser.py +0 -0
  107. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launcherfinder/registry.py +0 -0
  108. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launcherfinder/specs.py +0 -0
  109. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launchers/__init__.py +0 -0
  110. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launchers/direct.py +0 -0
  111. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launchers/oar.py +0 -0
  112. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launchers/slurm.py +0 -0
  113. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/locking.py +0 -0
  114. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mkdocs/__init__.py +0 -0
  115. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mkdocs/annotations.py +0 -0
  116. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mkdocs/base.py +0 -0
  117. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mkdocs/metaloader.py +0 -0
  118. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mkdocs/style.css +0 -0
  119. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mypy.py +0 -0
  120. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/notifications.py +0 -0
  121. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/rpyc.py +0 -0
  122. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/run.py +0 -0
  123. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/__init__.py +0 -0
  124. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/base.py +0 -0
  125. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/dependencies.py +0 -0
  126. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/environment.py +0 -0
  127. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/services.py +0 -0
  128. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/workspace.py +0 -0
  129. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scriptbuilder.py +0 -0
  130. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/server/__init__.py +0 -0
  131. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/settings.py +0 -0
  132. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/sphinx/__init__.py +0 -0
  133. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/sphinx/static/experimaestro.css +0 -0
  134. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/taskglobals.py +0 -0
  135. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/__init__.py +0 -0
  136. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/conftest.py +0 -0
  137. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/connectors/bin/executable.py +0 -0
  138. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/connectors/test_local.py +0 -0
  139. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/connectors/utils.py +0 -0
  140. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/definitions_types.py +0 -0
  141. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/__init__.py +0 -0
  142. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/bin/sacct +0 -0
  143. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/bin/sbatch +0 -0
  144. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/bin/test.py +0 -0
  145. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/common.py +0 -0
  146. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/config_slurm/__init__.py +0 -0
  147. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/config_slurm/launchers.yaml +0 -0
  148. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/test_local.py +0 -0
  149. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/test_slurm.py +0 -0
  150. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/restart.py +0 -0
  151. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/restart_main.py +0 -0
  152. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/scripts/notifyandwait.py +0 -0
  153. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/scripts/waitforfile.py +0 -0
  154. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/task_tokens.py +0 -0
  155. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/tasks/__init__.py +0 -0
  156. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/tasks/all.py +0 -0
  157. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/tasks/foreign.py +0 -0
  158. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/tasks/subparams.py +0 -0
  159. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_checkers.py +0 -0
  160. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_findlauncher.py +0 -0
  161. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_forward.py +0 -0
  162. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_objects.py +0 -0
  163. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_param.py +0 -0
  164. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_snippets.py +0 -0
  165. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_ssh.py +0 -0
  166. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_tags.py +0 -0
  167. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_tasks.py +0 -0
  168. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_tokens.py +0 -0
  169. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_types.py +0 -0
  170. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_validation.py +0 -0
  171. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/token_reschedule.py +0 -0
  172. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/utils.py +0 -0
  173. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tokens.py +0 -0
  174. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tools/__init__.py +0 -0
  175. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tools/diff.py +0 -0
  176. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tools/jobs.py +0 -0
  177. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/typingutils.py +0 -0
  178. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/__init__.py +0 -0
  179. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/asyncio.py +0 -0
  180. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/jupyter.py +0 -0
  181. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/resources.py +0 -0
  182. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/settings.py +0 -0
  183. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/yaml.py +0 -0
  184. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/xpmutils.py +0 -0
  185. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/dependency_links.txt +0 -0
  186. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/entry_points.txt +0 -0
  187. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/not-zip-safe +0 -0
  188. {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/top_level.txt +0 -0
  189. {experimaestro-0.23.0 → experimaestro-0.24.0}/tox.ini +0 -0
@@ -1,6 +1,7 @@
1
1
  from typing import Optional
2
2
  from experimaestro import config, Param, Config
3
3
  from experimaestro.core.objects import TypeConfig
4
+ from experimaestro.core.serializers import SerializedConfig
4
5
 
5
6
 
6
7
  @config()
@@ -31,27 +32,29 @@ def test_simple_instance():
31
32
  assert isinstance(b.a, A.__xpmtype__.basetype)
32
33
 
33
34
 
34
- @config()
35
- class SerializedConfig:
36
- x: Param[int] = 1
37
- pass
35
+ class Model(Config):
36
+ def __post_init__(self):
37
+ self.initialized = False
38
+
38
39
 
40
+ class Trainer(Config):
41
+ model: Param[Model]
39
42
 
40
- class TestSerialization:
41
- """Test that a config can be serialized during execution"""
42
43
 
43
- def test_instance(self):
44
- import pickle
44
+ class SerializedModel(SerializedConfig):
45
+ def initialize(self):
46
+ self.config.initialized = True
45
47
 
46
- a = SerializedConfig(x=2).instance()
47
- assert not isinstance(a, TypeConfig)
48
- assert isinstance(a, SerializedConfig)
49
48
 
50
- s_a = pickle.dumps(a)
49
+ def test_instance_serialized():
50
+ model = SerializedModel(config=Model())
51
+ trainer = Trainer(model=model)
52
+ instance = trainer.instance()
51
53
 
52
- deserialized = pickle.loads(s_a)
53
- assert not isinstance(deserialized, TypeConfig)
54
- assert deserialized.x == 2
54
+ assert isinstance(
55
+ instance.model, Model
56
+ ), f"The model is not a Model but a {type(instance.model).__qualname__}"
57
+ assert instance.model.initialized, "The model was not initialized"
55
58
 
56
59
 
57
60
  class ConfigWithOptional(Config):
@@ -0,0 +1,50 @@
1
+ """Test for task outputs"""
2
+
3
+ from experimaestro import Config, Task, Param, ConfigWrapper
4
+ from experimaestro.scheduler.workspace import RunMode
5
+
6
+
7
+ class B(Config):
8
+ x: Param[int] = 1
9
+
10
+
11
+ class A(Config):
12
+ b: Param[B]
13
+
14
+
15
+ class Main(Task):
16
+ a: Param[A]
17
+
18
+ def taskoutputs(self):
19
+ return self.a, {
20
+ "a": self.a,
21
+ }
22
+
23
+ def execute(self):
24
+ print(self.a.b.x) # noqa: T201
25
+
26
+
27
+ class MainB(Task):
28
+ b: Param[B]
29
+
30
+ def execute(self):
31
+ pass
32
+
33
+
34
+ def test_output_taskoutput():
35
+ a = A(b=B())
36
+ output, ioutput = Main(a=a).submit(run_mode=RunMode.DRY_RUN)
37
+
38
+ assert isinstance(output, ConfigWrapper), "outputs should be task proxies"
39
+
40
+ # Direct
41
+ Main(a=output)
42
+
43
+ # Via getattr
44
+ Main(a=A(b=output.b))
45
+
46
+ # Via getitem
47
+ Main(a=ioutput["a"])
48
+
49
+ # Now, submits
50
+ Main(a=output).submit(run_mode=RunMode.DRY_RUN)
@@ -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()
@@ -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.23.0'
4
- __version_tuple__ = version_tuple = (0, 23, 0)
3
+ __version__ = version = '0.24.0'
4
+ __version_tuple__ = version_tuple = (0, 24, 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: experimaestro
3
- Version: 0.23.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
@@ -127,6 +127,21 @@ if __name__ == "__main__":
127
127
 
128
128
  which can be launched with `python test.py /tmp/helloworld-workdir`
129
129
 
130
+ ## 0.24.0 (2023-05-23)
131
+
132
+ ### Feat
133
+
134
+ - serialized configurations
135
+
136
+ ### Fix
137
+
138
+ - requirement for fabric
139
+ - add gevent-websocket for supporting websockets
140
+
141
+ ### Refactor
142
+
143
+ - Changed TaskOutput to ConfigWrapper
144
+
130
145
  ## 0.23.0 (2023-04-07)
131
146
 
132
147
  ### Feat
@@ -106,6 +106,7 @@ src/experimaestro/core/arguments.py
106
106
  src/experimaestro/core/context.py
107
107
  src/experimaestro/core/objects.py
108
108
  src/experimaestro/core/objects.pyi
109
+ src/experimaestro/core/serializers.py
109
110
  src/experimaestro/core/types.py
110
111
  src/experimaestro/launcherfinder/__init__.py
111
112
  src/experimaestro/launcherfinder/base.py
@@ -145,7 +146,7 @@ src/experimaestro/tests/test_objects.py
145
146
  src/experimaestro/tests/test_outputs.py
146
147
  src/experimaestro/tests/test_param.py
147
148
  src/experimaestro/tests/test_progress.py
148
- src/experimaestro/tests/test_serialization.py
149
+ src/experimaestro/tests/test_serializers.py
149
150
  src/experimaestro/tests/test_snippets.py
150
151
  src/experimaestro/tests/test_ssh.py
151
152
  src/experimaestro/tests/test_tags.py
@@ -13,12 +13,14 @@ pyparsing
13
13
  humanfriendly
14
14
  huggingface_hub~=0.11.1
15
15
  gevent
16
+ gevent-websocket
16
17
  flask
17
18
  flask-socketio
18
19
  Arpeggio>=2.0
19
20
  watchdog>2.0.0
20
21
  marshmallow
21
22
  fabric
23
+ decorator
22
24
  rpyc
23
25
 
24
26
  [:python_version < "3.11"]
@@ -1,88 +0,0 @@
1
- """Test for task outputs"""
2
-
3
- from experimaestro import Config, Task, Param
4
- from experimaestro.core.objects import SerializedConfig, Serialized, TaskOutput
5
- from experimaestro.scheduler.workspace import RunMode
6
- from experimaestro.tests.utils import TemporaryExperiment
7
-
8
-
9
- class B(Config):
10
- x: Param[int] = 1
11
-
12
-
13
- class A(Config):
14
- b: Param[B]
15
-
16
-
17
- class LoaderA(Serialized):
18
- @staticmethod
19
- def fromJSON(x) -> A:
20
- return A(b=B(x=x)).instance()
21
-
22
-
23
- class Main(Task):
24
- a: Param[A]
25
-
26
- def taskoutputs(self):
27
- return self.a, {
28
- "a": self.a,
29
- "serialized": SerializedConfig(self.a, LoaderA(self.a.b.x)),
30
- }
31
-
32
- def execute(self):
33
- print(self.a.b.x) # noqa: T201
34
-
35
-
36
- class MainB(Task):
37
- b: Param[B]
38
-
39
- def execute(self):
40
- pass
41
-
42
-
43
- def test_output_taskoutput():
44
- a = A(b=B())
45
- output, ioutput = Main(a=a).submit(run_mode=RunMode.DRY_RUN)
46
-
47
- assert isinstance(ioutput["serialized"], TaskOutput)
48
- assert isinstance(output, TaskOutput), "outputs should be task proxies"
49
-
50
- # Direct
51
- Main(a=output)
52
-
53
- # Via getattr
54
- Main(a=A(b=output.b))
55
-
56
- # Via getitem
57
- Main(a=ioutput["a"])
58
-
59
- # Now, submits
60
- Main(a=output).submit(run_mode=RunMode.DRY_RUN)
61
-
62
-
63
- def test_output_serialization():
64
- """Test output serialization"""
65
-
66
- with TemporaryExperiment("output_serialization", maxwait=5) as xp:
67
- a = A(b=B(x=2))
68
-
69
- main0 = Main(a=a)
70
- output, ioutput = main0.submit()
71
-
72
- # Direct
73
- serialized_a = ioutput["serialized"]
74
- main1 = Main(a=serialized_a)
75
- main1.submit()
76
-
77
- # Indirect (via attribute)
78
- serialized_a = ioutput["serialized"]
79
- main2 = Main(a=A(b=serialized_a.b))
80
- main2.submit()
81
-
82
- xp.wait()
83
-
84
- for main in (main1, main2):
85
- assert main.__xpm__.job.stdout.read_text().strip() == "2"
86
- assert len(main.__xpm__.job.dependencies) == 1
87
- dep = next(iter(main.__xpm__.job.dependencies))
88
- assert dep.origin.config is main0
@@ -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
- )
File without changes
File without changes
File without changes
File without changes
File without changes