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.
Metadata
Release files for digital-experiments 2.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| digital-experiments-2.0.4.tar.gz | 16.5 kB | Without provenance | Details for digital-experiments-2.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| digital_experiments-2.0.4-py3-none-any.whl | Python 3 | none | any | Details for digital_experiments-2.0.4-py3-none-any.whl |
Total release size: 31.3 kB
Release files / digital-experiments-2.0.4.tar.gz
| Download URL | digital-experiments-2.0.4.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d56ededcf3dfbfb71e73e9dc265f7d455eeefa4b5c8dfa521602645d91a5ba8
|
|
BLAKE2b-256 checksum How to use checksums |
9ef3c44483773315df9637bbd72404652403a15fa618833b6c67114a96a00101
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Release files / digital_experiments-2.0.4-py3-none-any.whl
| Download URL | digital_experiments-2.0.4-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
185bfa54de04b3f10c846451fcb94b87d2bbe7a8bdbfcfefdf0e46fd5f781896
|
|
BLAKE2b-256 checksum How to use checksums |
1967cde5f4f889b6c9c558cf6c60f2f3ea7cc0faad542501b66bb32a31179b2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Security for digital-experiments 2.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.