Skip to main content

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

Project description

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 just pip:

$ pip install pystematic

Defining and running experiments

Experiments and parameters are defined with decorators. The following example defines an experiment named example_experiment with two parameters, string_param and int_param:

import pystematic

@pystematic.parameter(
    name="string_param",
    type=str,
    help="A string parameter"
)
@pystematic.parameter(
    name="int_param",
    type=int,
    help="An int parameter",
    default=0
)
@pystematic.experiment
def example_experiment(params):
    print("Hello from example_experiment.")
    print(f"string_param is {params['string_param']} and int_param is {params['int_param']}.")

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

example_experiment.run({
    "string_param": "hello",
    "int_param": 10
})

Or you can run the experiment from the command line:

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

and then from the terminal:

$ python path/to/file.py --string-param hello --int-param 10

Extensions

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

Documentation

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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pystematic-1.1.2-py3-none-any.whl (21.5 kB view hashes)

Uploaded Python 3

Supported by

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