Keep track of digital experiments.
Project description
A lightweight python package for recording and analysing configurations and results of coding experiments.
Keeping track of the results of coding experiments can be a pain. Over time, code and dependencies can change, and without careful record-keeping, it becomes difficult to remember and reproduce optimal configurations and results.
digital-experiments automates such tracking. To enable this automation, wrap your experiment's main function with the @experiment decorator. Every time the function is called, the following information is saved to disk:
- the inputs (
args,kwargsand defaults) - the output/s (any, arbitrary object)
- the code of the function
- the current
gitinformation (if available) - timing information
- python environment information
This information is available for analysis in the same or different python sessions, via the observations API.
To get started, see the basic use case below, or our example notebook.
Installation
pip install digital-experiments
Basic Use
- Define your experiment as a pure-python function, and decorate it with
@experiment:
from digital_experiments import experiment
@experiment
def my_experiment(a, b=2):
return a ** b
- Call the function as normal:
>>> my_experiment(2, 3)
8
>>> my_experiment(4)
16
- Access the results of the experiment:
>>> my_experiment.observations()
[Observation(<id1>, {'a': 2, 'b': 3} → 8}),
Observation(<id2>, {'a': 4, 'b': 2} → 16})]
If you have pandas installed, you can also access these results as a DataFrame:
>>> my_experiment.to_dataframe()
id config.a config.b result
0 <id1> 2 3 8
1 <id2> 4 2 16
Documentation
For more information, see the documentation.
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file digital-experiments-2.0.4.tar.gz.
File metadata
- Download URL: digital-experiments-2.0.4.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d56ededcf3dfbfb71e73e9dc265f7d455eeefa4b5c8dfa521602645d91a5ba8
|
|
| MD5 |
50e6614a57d95cbba1ee88e9670c9ffc
|
|
| BLAKE2b-256 |
9ef3c44483773315df9637bbd72404652403a15fa618833b6c67114a96a00101
|
File details
Details for the file digital_experiments-2.0.4-py3-none-any.whl.
File metadata
- Download URL: digital_experiments-2.0.4-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
185bfa54de04b3f10c846451fcb94b87d2bbe7a8bdbfcfefdf0e46fd5f781896
|
|
| MD5 |
beca248a5c22e1de42705d810eb7e58a
|
|
| BLAKE2b-256 |
1967cde5f4f889b6c9c558cf6c60f2f3ea7cc0faad542501b66bb32a31179b2e
|