Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

A tool for reproducible scientific computing

Project description

Installing.

pip install repsci

Import the logging library.

import repsci

Create an experiment. A unique directory will be created with the experiment name, a timestamp, and the current git hash.

exp_name = "hello_world"
exp = repsci.Experiment(exp_name)

Get the logger and write a log message.

log = exp.get_logger()
log.debug("Hello, World!")

Create an output file in the unique output directory.

filename = exp.get_filename('output.csv')
with open(filename, "wb") as f:
    f.write("Hello, World\n")

The state of python's random number generator is stored in random_state.bin in pickle format. This state can be used to reproduce the output of randomized scripts.

The Experiment constructor also has some optional parameters:

  • note: a string of notes to store in a notes.txt file in the output directory.
  • config: a configparser object, which will exported to the output directory.
  • output_dir: the subdirectory of the current directory to place experiment directories in.
  • suffix: a string to append to the end of the trial's directory.

Create an experiment from a previous experiment's unique directory.

exp_name = "hello_world"
timestamp = "2020-09-09 152600"
exp = repsci.Experiment(exp_name, reproduce=timestamp)

Get the config from the prevous experiment.

config = exp.get_config()

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 repsci, version 1.1.8
Filename, size File type Python version Upload date Hashes
Filename, size repsci-1.1.8-py3-none-any.whl (4.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size repsci-1.1.8.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page