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.
- {experimaestro-0.23.0 → experimaestro-0.24.0}/CHANGELOG.md +15 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/PKG-INFO +16 -1
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/experiments/task.md +45 -7
- {experimaestro-0.23.0 → experimaestro-0.24.0}/pyproject.toml +1 -1
- {experimaestro-0.23.0 → experimaestro-0.24.0}/requirements.txt +3 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/__init__.py +3 -3
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/__main__.py +2 -2
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/objects.py +167 -129
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/objects.pyi +2 -1
- experimaestro-0.24.0/src/experimaestro/core/serializers.py +52 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/huggingface.py +2 -2
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_identifier.py +33 -6
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_instance.py +18 -15
- experimaestro-0.24.0/src/experimaestro/tests/test_outputs.py +50 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_progress.py +7 -9
- experimaestro-0.24.0/src/experimaestro/tests/test_serializers.py +54 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/jobs.py +2 -2
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/version.py +2 -2
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/PKG-INFO +16 -1
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/SOURCES.txt +2 -1
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/requires.txt +2 -0
- experimaestro-0.23.0/src/experimaestro/tests/test_outputs.py +0 -88
- experimaestro-0.23.0/src/experimaestro/tests/test_serialization.py +0 -45
- {experimaestro-0.23.0 → experimaestro-0.24.0}/.circleci/config.yml +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/.flake8 +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/.github/release.yaml +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/.github/workflows/pytest.yml +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/.github/workflows/python-publish.yml +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/.gitignore +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/.gitmodules +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/.pre-commit-config.yaml +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/.prettierignore +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/.readthedocs.yml +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/LICENSE +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/MANIFEST.in +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/README.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/.gitignore +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/.nolluprc.js +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/CHANGELOG.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/README.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/package-lock.json +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/package.json +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/postcss.config.js +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/public/favicon.ico +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/public/index.html +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/public/login.html +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/public/manifest.json +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/App.tsx +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/Experiments.tsx +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/Services.tsx +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/TaskDetail.tsx +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/TaskJobs.tsx +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/Tasks.tsx +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/client.ts +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/clipboard.ts +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/index.css +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/index.tsx +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/logo.png +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/logo.pxm +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/reducers.ts +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/store.ts +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/theme/_jobs.scss +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/theme/theme.scss +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/src/ui/messages.tsx +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/tsconfig.json +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/webpack.config.ts +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/app/xp/run.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/changelog.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/cli.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/concepts.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/configuration.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/connectors/index.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/documenting.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/experiments/config.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/experiments/overview.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/experiments/plan.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/faq.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/index.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/jupyter.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/launchers/index.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/requirements.txt +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/serialization.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/docs/tutorial.md +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/mkdocs.yml +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/pytest.ini +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/scripts/longtask.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/setup.cfg +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/setup.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/annotations.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/checkers.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/click.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/commandline.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/compat.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/connectors/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/connectors/local.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/connectors/ssh.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/arguments.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/context.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/core/types.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/filter.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/generators.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/ipc.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launcherfinder/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launcherfinder/base.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launcherfinder/parser.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launcherfinder/registry.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launcherfinder/specs.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launchers/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launchers/direct.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launchers/oar.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/launchers/slurm.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/locking.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mkdocs/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mkdocs/annotations.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mkdocs/base.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mkdocs/metaloader.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mkdocs/style.css +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/mypy.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/notifications.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/rpyc.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/run.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/base.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/dependencies.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/environment.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/services.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scheduler/workspace.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/scriptbuilder.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/server/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/settings.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/sphinx/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/sphinx/static/experimaestro.css +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/taskglobals.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/conftest.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/connectors/bin/executable.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/connectors/test_local.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/connectors/utils.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/definitions_types.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/bin/sacct +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/bin/sbatch +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/bin/test.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/common.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/config_slurm/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/config_slurm/launchers.yaml +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/test_local.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/launchers/test_slurm.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/restart.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/restart_main.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/scripts/notifyandwait.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/scripts/waitforfile.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/task_tokens.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/tasks/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/tasks/all.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/tasks/foreign.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/tasks/subparams.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_checkers.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_findlauncher.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_forward.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_objects.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_param.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_snippets.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_ssh.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_tags.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_tasks.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_tokens.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_types.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/test_validation.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/token_reschedule.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tests/utils.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tokens.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tools/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tools/diff.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/tools/jobs.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/typingutils.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/__init__.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/asyncio.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/jupyter.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/resources.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/settings.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/utils/yaml.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro/xpmutils.py +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/dependency_links.txt +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/entry_points.txt +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/not-zip-safe +0 -0
- {experimaestro-0.23.0 → experimaestro-0.24.0}/src/experimaestro.egg-info/top_level.txt +0 -0
- {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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
44
|
-
|
|
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
|
-
|
|
49
|
+
def test_instance_serialized():
|
|
50
|
+
model = SerializedModel(config=Model())
|
|
51
|
+
trainer = Trainer(model=model)
|
|
52
|
+
instance = trainer.instance()
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
|
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()
|
|
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
|
-
|
|
91
|
-
logger.info("Got %s",
|
|
92
|
-
assert
|
|
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:
|
|
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:
|
|
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
|
|
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:
|
|
9
|
+
def jobmonitor(*outputs: ConfigWrapper):
|
|
10
10
|
"""Follow the progress of a list of jobs (in order)"""
|
|
11
11
|
|
|
12
12
|
cv = Condition()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: experimaestro
|
|
3
|
-
Version: 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/
|
|
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
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|