"Experimaestro is a computer science experiment manager"
Project description
Experimaestro is a computer science experiment manager whose goals are:
- To decompose experiments into a set of parameterizable tasks
- Schedule tasks and handle dependencies between tasks
- Avoids to re-run the same task two times by computing unique task IDs dependending on the parameters
- Handle experimental parameters through tags
The full documentation can be read by going to the following URL: https://experimaestro-python.readthedocs.io
Install
With pip
You can then install the package using pip install experimaestro
Develop
Checkout the git directory, then
pip install -e .
Example
This very simple example shows how to submit two tasks that concatenate two strings. Under the curtain,
- A directory is created for each task (in
workdir/jobs/helloworld.add/HASHID
) based on a unique ID computed from the parameters - Two processes for
Say
are launched (there are no dependencies, so they will be run in parallel) - A tag
y
is created for the main task
# --- Task and types definitions
import logging
logging.basicConfig(level=logging.DEBUG)
from pathlib import Path
from experimaestro import Task, Param, experiment, progress
import click
import time
import os
from typing import List
# --- Just to be able to monitor the tasks
def slowdown(sleeptime: int, N: int):
logging.info("Sleeping %ds after each step", sleeptime)
for i in range(N):
time.sleep(sleeptime)
progress((i+1)/N)
# --- Define the tasks
class Say(Task):
word: Param[str]
sleeptime: Param[float]
def execute(self):
slowdown(self.sleeptime, len(self.word))
print(self.word.upper(),)
class Concat(Task):
strings: Param[List[Say]]
sleeptime: Param[float]
def execute(self):
says = []
slowdown(self.sleeptime, len(self.strings))
for string in self.strings:
with open(string.__xpm_stdout__) as fp:
says.append(fp.read().strip())
print(" ".join(says))
# --- Defines the experiment
@click.option("--port", type=int, default=12345, help="Port for monitoring")
@click.option("--sleeptime", type=float, default=2, help="Sleep time")
@click.argument("workdir", type=Path)
@click.command()
def cli(port, workdir, sleeptime):
"""Runs an experiment"""
# Sets the working directory and the name of the xp
with experiment(workdir, "helloworld", port=port) as xp:
# Submit the tasks
hello = Say(word="hello", sleeptime=sleeptime).submit()
world = Say(word="world", sleeptime=sleeptime).submit()
# Concat will depend on the two first tasks
Concat(strings=[hello, world], sleeptime=sleeptime).tag("y", 1).submit()
if __name__ == "__main__":
cli()
which can be launched with python test.py /tmp/helloworld-workdir
0.29.4 (2023-06-26)
Fix
- better instance()
0.29.3 (2023-06-26)
Fix
- identifiers
0.29.2 (2023-06-21)
Fix
- pre-task are properly handled
0.29.1 (2023-06-20)
Fix
- exception thrown when adding pre-task to a sealed config
0.29.0 (2023-06-19)
Fix
- pre task dependencies are taken into account
0.28.0 (2023-06-16)
BREAKING CHANGE
-
- subparam were removed (should be replaced by something more stable)
- serialiazed configurations were removed (too much trouble too)
Feat
- show dependencies when simulating
- removed config wrapper
- easier path LW task access
- Lightweight-pre-tasks: Lightweight pre-tasks allow code to be executed to modify objects
Fix
- bug in dependency tracking
0.27.0 (2023-05-26)
Feat
- Expose the unwrap function
Fix
- Removes unnecessary server logs
0.26.0 (2023-05-26)
Fix
- Fix submit hooks (and document them)
0.25.0 (2023-05-26)
0.24.0 (2023-05-23)
Feat
- serialized configurations
Fix
- requirement for fabric
- add gevent-websocket for supporting websockets
Refactor
- Changed TaskOutput to ConfigWrapper
0.23.0 (2023-04-07)
Feat
- submit hooks to allow e.g. changing the environment variables
0.22.0 (2023-04-05)
Feat
- tags as immutable and hashable dicts
Fix
- corrected service status update for servers
- improved server
0.21.0 (2023-03-28)
Feat
- When an experiment fails, display the path to stderr
- service proxying
Fix
- Information message when locking experiment
- Improving slurm support
- Fix test bugs
- better handlign of services
Refactor
- server: switched to flask and socketio for future evolutions of the server
0.20.0 (2023-02-18)
Feat
- improvements for dry-run modes to show completed jobs
Refactor
- more reliable identifier computation
0.19.2 (2023-02-16)
Fix
- better identifier recomputation
0.19.1 (2023-02-15)
Fix
- fix bugs with generate/dry-run modes
0.19.0 (2023-02-14)
Feat
- allow using the old task identifier computation to fix params.json
0.18.0 (2023-02-13)
BREAKING CHANGE
- New identifiers will be different in all cases - use the deprecated command to recompute identifiers for old experiments
- For any task output which is different than the task itself, the identifier will change
Feat
- configuration: re-use computed sub-configuration identifiers
Fix
- server: fix some display bugs in the UI
- configuration: fixed more bugs with identifiers
- configuration: fixed bugs with identifiers
- configuration: serialize the task to recompute exactly the identifier
Refactor
- removed jsonstreams dependency
0.16.0 (2023-02-08)
Feat
- server: web services for experiment server
0.15.1 (2023-02-08)
Fix
- wrong indent
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
experimaestro-0.29.4.zip
(5.2 MB
view hashes)
Built Distribution
Close
Hashes for experimaestro-0.29.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1244d27f57decc660345dcbfb595b56d104c7f5a54647f34b7cb1914ba639adc |
|
MD5 | 14c3c8514076d95ef19b5d753b04c179 |
|
BLAKE2b-256 | ea57c9560919afc0897407676099f1e9aa93571784d4252e46b2f3395bd5cebb |