Skip to main content

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.

Source Distribution

repsci-1.1.8.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

repsci-1.1.8-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file repsci-1.1.8.tar.gz.

File metadata

  • Download URL: repsci-1.1.8.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5

File hashes

Hashes for repsci-1.1.8.tar.gz
Algorithm Hash digest
SHA256 93228cf9afb06b01b1cfdc69dea000b41a64de3c6b06a1991551f92be1918e20
MD5 5174a62e690ffc43064ff8cf97bcdae6
BLAKE2b-256 9147afd24e5359501a7956f2bc058800486d32ab242324ffeadd337450af821b

See more details on using hashes here.

File details

Details for the file repsci-1.1.8-py3-none-any.whl.

File metadata

  • Download URL: repsci-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5

File hashes

Hashes for repsci-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 49895916a4c6d153b61247cfa5a6d85081a16db1240d446bbe0e9239a9b89868
MD5 839f8353aacadc2de4010aea2fd65df5
BLAKE2b-256 87f2eec41971be4d944af88a74abd2a7c4bd3c40c9268c91173dcce4c863d50e

See more details on using hashes here.

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