Skip to main content

expnbk provides a class for creating an experiment with its own results directory that automatically contains a copy of the code used to run the experiment. Super useful for reproducibility.

Project description

Experiment_Notebook

PyPI Version Supported Python Versions

expnbk provides a class for creating an experiment with its own results directory that automatically contains a copy of the code used to run the experiment. Super useful for reproducibility.


Installation

To install Experiment_Notebook, run this command in your terminal:

$ pip install -U expnbk

This is the preferred method to install Experiment_Notebook, as it will always install the most recent stable release.

If you don't have pip installed, these installation instructions can guide you through the process.

Quick Start

The expnbk package provides a class Experiment. Upon instantiation, it takes a snapshot of the current working directory and saves all files into a results/current_time folder within the current directory (see Usage for variations). It also provides functions that automatically save figures to the same output directory. Check out the following example and you shall see similar changes in your directories.

$ tree
    .
    ├── file1        
    └── dir1
        └── file2
>>> from expnbk import Experiment
>>> exp = Experiment()
>>> fig = exp.figure()
>>> fig.savefig("image1.png") 
$ tree
    .
    ├── file1
    ├── dir1
    │   └── file2
    └── results
        └── 2020-12-31_123006
            ├── <project_name>
            │   ├── file1
            │   └── dir1
            │       └── file2
            └── image1.png

Usage

  • Import the expnk package:
>>> from expnbk import Experiment
  • Create an Experiment class with attributes:
>>> exp = Experiment(expname='some_experiemnt', results_dir='path_to_results_directory', copy_code=True, ignore_dirs=None):

expname: str, optional

A name identifying the type of experiment run.

results_dir : str, optional

Path to the desired results directory for storing experiment details.

copy_code : bool, optional

Should the experiment results include the code used to generate them?

ignore_dirs : list(str), optional

Any directories that should not be copied with the code.

  • Save figures to the same output directory as above:
>>> fig = exp.figure() //Get a matplotlib figure
>>> fig.savefig("image1.png") //`savefig` function will put it in the experiment directory

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

expnbk-0.0.3.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

expnbk-0.0.3-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file expnbk-0.0.3.tar.gz.

File metadata

  • Download URL: expnbk-0.0.3.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.0

File hashes

Hashes for expnbk-0.0.3.tar.gz
Algorithm Hash digest
SHA256 13050844577aa9ff14914932a1463374377e2dc50d6fb21080d493f067dbe6d5
MD5 3e5abe066dfb98961e9ebfe0128d02f3
BLAKE2b-256 fa9604f078dadbaa517bc2feb38a25c6da911c069ab9eb7f8dbdcdd6c15870ad

See more details on using hashes here.

File details

Details for the file expnbk-0.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: expnbk-0.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.0

File hashes

Hashes for expnbk-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f8b2e70570a57a98e521b9cce0a591226c2b6d0d820e08d200eb48a7b9ba15a6
MD5 a981d8e94d2ebae220614036c702deb9
BLAKE2b-256 918be32eabbe553f7878281fc8db18a3c4864f83939bb410ae6c1a6a955ea77a

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