Skip to main content

A framework that helps you setup and run reproducible experiments in python.

Project description

https://img.shields.io/pypi/pyversions/pystematic?style=for-the-badge https://img.shields.io/pypi/v/pystematic?style=for-the-badge https://img.shields.io/github/workflow/status/evalldor/pystematic/Test?style=for-the-badge https://readthedocs.org/projects/pystematic/badge/?style=for-the-badge

Pystematic is a lightweight framework that helps you to systematically setup and run reproducible computational experiments in python.

Main features:

  • Standardizes how experiments and associated parameters are defined.
  • Provides both CLI and programmatic interfaces for running your experiments.
  • Encourages reproducibility by isolating experiment outputs and providing tools for managing random seeds.

Quickstart

Installation

pystematic is available on pypi, and can be installed with your package manager of choice.

If using poetry:

$ poetry add pystematic

or with pip:

$ pip install pystematic

Defining and running experiments

Experiments and parameters are defined by decorating the main function of the experiment. The following example defines an experiment named hello_world with a single parameter name:

@ps.parameter(
    name="name",
    type=str,
    help="The name to greet.",
    required=True
)
@ps.experiment
def hello_world(params):
    print(f"Hello {params['name']}!")

You can run the experiment either by supplying a dict containing the values for the parameters:

hello_world.run({
    "name": "World",
})

or you can run the experiment from the command line by invoking the cli() method of the experiment:

if __name__ == "__main__":
    hello_world.cli()

Then from the terminal you simply run:

$ python path/to/file.py --name "World"

Documentation

Full documentation is available at https://pystematic.readthedocs.io.

Extensions

For running machine learning experiments in pytorch check out the pystematic-torch plugin.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pystematic, version 1.5.1
Filename, size File type Python version Upload date Hashes
Filename, size pystematic-1.5.1-py3-none-any.whl (25.5 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page