Skip to main content

Experimaestro is a computer science experiment manager

Project description

PyPI version RTD

Experimaestro helps in designing and managing complex experimental plans. It allows for the definition of tasks and their dependencies, ensuring that each step in a workflow is executed in the correct order. Some key aspects of Experimaestro are:

  • Task Automation: The tool automates repetitive tasks, making it easier to run large-scale experiments. It's particularly useful in scenarios where experiments need to be repeated with different parameters or datasets.
  • Resource Management: It efficiently manages computational resources, which is critical when dealing with data-intensive tasks or when running multiple experiments in parallel.
  • Reproducibility: By keeping a detailed record of experiments (the experimental plan in python), including parameters and environments, it aids in ensuring the reproducibility of scientific experiments, which is a fundamental requirement in research.
  • User Interface: While primarily a back-end tool, Experimaestro also offers a user interface to help in managing and visualizing workflows (web and text-based).

The full documentation can be read by going to the following URL: https://experimaestro-python.readthedocs.io. A tutorial (training a CNN on MNIST) is available on github.

Screenshots

Textual interface (new in v2)

Experiments screen
Experiments overview: monitor (local or SSH) running and completed experiments
Jobs screen
Jobs view: track job status, progress, and dependencies
Job details screen
Job details: inspect individual job parameters and output
Logs screen
Logs view: real-time log streaming for running tasks
Services screen
Services view: monitor background services and their status

Install

With pip

You can then install the package using pip install experimaestro

Develop

Checkout the git directory, then

pip install -e .

Coding assistant skill

Experimaestro ships an agent skill that teaches LLM coding assistants (Claude Code, Cursor, …) the framework's conventions and best practices. Install it with:

# Default: ~/.agents/skills/ (cross-client open standard)
experimaestro install-skill

# Install for a specific tool
experimaestro install-skill claude     # ~/.claude/skills/
experimaestro install-skill cursor     # ~/.cursor/skills/

# Install to several targets at once
experimaestro install-skill agents claude

# List available targets and what is already installed
experimaestro install-skill --list

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.C(word="hello", sleeptime=sleeptime).submit()
        world = Say.C(word="world", sleeptime=sleeptime).submit()

        # Concat will depend on the two first tasks
        Concat.C(strings=[hello, world], sleeptime=sleeptime).tag("y", 1).submit()


if __name__ == "__main__":
    cli()

which can be launched with python test.py /tmp/helloworld-workdir

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-2.5.2.tar.gz (28.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

experimaestro-2.5.2-py3-none-any.whl (3.1 MB view details)

Uploaded Python 3

File details

Details for the file experimaestro-2.5.2.tar.gz.

File metadata

  • Download URL: experimaestro-2.5.2.tar.gz
  • Upload date:
  • Size: 28.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for experimaestro-2.5.2.tar.gz
Algorithm Hash digest
SHA256 393ec55818a03104fe85a243520d8ad7fc682481b9e9100d471dc6cec8c5ecf3
MD5 f98e8e395b8ac7c8e0ee608fc58a512c
BLAKE2b-256 c3f158838885f13948f4846b47f883dd6459c4978b4bbc74dd6bc391da26eed7

See more details on using hashes here.

Provenance

The following attestation bundles were made for experimaestro-2.5.2.tar.gz:

Publisher: python-publish.yml on experimaestro/experimaestro-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file experimaestro-2.5.2-py3-none-any.whl.

File metadata

  • Download URL: experimaestro-2.5.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for experimaestro-2.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f89e8266fc47b17f5a7425da7fa9ea3f3d8b9cd65555b248058e4d34cabc3d8f
MD5 acd308c5943a77d2d158c5a63c0263b7
BLAKE2b-256 025f2c241d27e75d5cef4706b3634d59c3caccdb25f2ae025f08ab2c67c85eb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for experimaestro-2.5.2-py3-none-any.whl:

Publisher: python-publish.yml on experimaestro/experimaestro-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page