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
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 Distributions
Built Distribution
Hashes for pystematic-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f441ce09c09ae64b1543b9a0a62adfdd3653300c0c8ae8b5b570ab0aafcfc5d |
|
MD5 | 2fec21a3f1ce0085f8062499a6961a4a |
|
BLAKE2b-256 | 27b0f07e0b0989aebadb911f8f75de2fd03620ff94a098e5ebafaa9155ce4f36 |