digital-experiments


Namedigital-experiments JSON
Version 2.0.4 PyPI version JSON
download
home_page
SummaryKeep track of digital experiments.
upload_time2024-02-24 12:24:28
maintainer
docs_urlNone
author
requires_python>=3.8
licenseCopyright 2022 John Gardner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords config experiments optimisation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
    <img src="docs/source/logo.svg" style="width: 400px; height: auto;"/>
</div>

<div align="center">
    
A lightweight python package for recording and analysing configurations and results of coding experiments.

[![PyPI](https://img.shields.io/pypi/v/digital-experiments)](https://pypi.org/project/digital-experiments/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/digital-experiments?color=green&label=installs&logo=Python&logoColor=white)](https://pypistats.org/packages/digital-experiments)
[![GitHub](https://img.shields.io/github/license/jla-gardner/digital-experiments)](LICENCE.md)
[![](https://github.com/jla-gardner/digital-experiments/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/jla-gardner/digital-experiments/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/jla-gardner/digital-experiments/branch/master/graph/badge.svg?token=VGSFM0GWF1)](https://codecov.io/gh/jla-gardner/digital-experiments)

</div>

---

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`](https://jla-gardner.github.io/digital-experiments/core-api.html#digital_experiments.experiment) decorator. Every time the function is called, the following information is saved to disk:
- the inputs (`args`, `kwargs` and defaults)
- the output/s (any, arbitrary object)
- the code of the function
- the current `git` information (if available)
- timing information
- python environment information

This information is available for analysis in the same or different python sessions, via the [`observations` API](https://jla-gardner.github.io/digital-experiments/core-api.html#digital_experiments.core.Experiment.observations).

To get started, see the basic use case below, or [our example notebook](https://jla-gardner.github.io/digital-experiments/usage.html).


## Installation

`pip install digital-experiments`

## Basic Use


1. Define your experiment as a pure-python function, and decorate it with `@experiment`:

```python
from digital_experiments import experiment

@experiment
def my_experiment(a, b=2):
    return a ** b
```

2. Call the function as normal:

```python
>>> my_experiment(2, 3)
8
>>> my_experiment(4)
16
```

3. Access the results of the experiment:

```python
>>> 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`:

```python
>>> 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](https://jla-gardner.github.io/digital-experiments/).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "digital-experiments",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "config,experiments,optimisation",
    "author": "",
    "author_email": "John Gardner <gardner.john97@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/9e/f3/c44483773315df9637bbd72404652403a15fa618833b6c67114a96a00101/digital-experiments-2.0.4.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n    <img src=\"docs/source/logo.svg\" style=\"width: 400px; height: auto;\"/>\n</div>\n\n<div align=\"center\">\n    \nA lightweight python package for recording and analysing configurations and results of coding experiments.\n\n[![PyPI](https://img.shields.io/pypi/v/digital-experiments)](https://pypi.org/project/digital-experiments/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/digital-experiments?color=green&label=installs&logo=Python&logoColor=white)](https://pypistats.org/packages/digital-experiments)\n[![GitHub](https://img.shields.io/github/license/jla-gardner/digital-experiments)](LICENCE.md)\n[![](https://github.com/jla-gardner/digital-experiments/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/jla-gardner/digital-experiments/actions/workflows/tests.yaml)\n[![codecov](https://codecov.io/gh/jla-gardner/digital-experiments/branch/master/graph/badge.svg?token=VGSFM0GWF1)](https://codecov.io/gh/jla-gardner/digital-experiments)\n\n</div>\n\n---\n\nKeeping track of the results of coding experiments can be a pain. \nOver time, code and dependencies can change, and without careful record-keeping, it becomes difficult to remember and reproduce optimal configurations and results.\n\n\n`digital-experiments` automates such tracking. To enable this automation, wrap your experiment's main function with the [`@experiment`](https://jla-gardner.github.io/digital-experiments/core-api.html#digital_experiments.experiment) decorator. Every time the function is called, the following information is saved to disk:\n- the inputs (`args`, `kwargs` and defaults)\n- the output/s (any, arbitrary object)\n- the code of the function\n- the current `git` information (if available)\n- timing information\n- python environment information\n\nThis information is available for analysis in the same or different python sessions, via the [`observations` API](https://jla-gardner.github.io/digital-experiments/core-api.html#digital_experiments.core.Experiment.observations).\n\nTo get started, see the basic use case below, or [our example notebook](https://jla-gardner.github.io/digital-experiments/usage.html).\n\n\n## Installation\n\n`pip install digital-experiments`\n\n## Basic Use\n\n\n1. Define your experiment as a pure-python function, and decorate it with `@experiment`:\n\n```python\nfrom digital_experiments import experiment\n\n@experiment\ndef my_experiment(a, b=2):\n    return a ** b\n```\n\n2. Call the function as normal:\n\n```python\n>>> my_experiment(2, 3)\n8\n>>> my_experiment(4)\n16\n```\n\n3. Access the results of the experiment:\n\n```python\n>>> my_experiment.observations()\n[Observation(<id1>, {'a': 2, 'b': 3} \u2192 8}),\nObservation(<id2>, {'a': 4, 'b': 2} \u2192 16})]\n```\n\nIf you have `pandas` installed, you can also access these results as a `DataFrame`:\n\n```python\n>>> my_experiment.to_dataframe()\n      id  config.a  config.b  result\n0  <id1>         2         3       8\n1  <id2>         4         2      16\n```\n\n## Documentation\n\nFor more information, see the [documentation](https://jla-gardner.github.io/digital-experiments/).\n",
    "bugtrack_url": null,
    "license": "Copyright 2022 John Gardner  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Keep track of digital experiments.",
    "version": "2.0.4",
    "project_urls": {
        "Homepage": "https://github.com/jla-gardner/digital-experiments"
    },
    "split_keywords": [
        "config",
        "experiments",
        "optimisation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1967cde5f4f889b6c9c558cf6c60f2f3ea7cc0faad542501b66bb32a31179b2e",
                "md5": "beca248a5c22e1de42705d810eb7e58a",
                "sha256": "185bfa54de04b3f10c846451fcb94b87d2bbe7a8bdbfcfefdf0e46fd5f781896"
            },
            "downloads": -1,
            "filename": "digital_experiments-2.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "beca248a5c22e1de42705d810eb7e58a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 14862,
            "upload_time": "2024-02-24T12:24:26",
            "upload_time_iso_8601": "2024-02-24T12:24:26.680311Z",
            "url": "https://files.pythonhosted.org/packages/19/67/cde5f4f889b6c9c558cf6c60f2f3ea7cc0faad542501b66bb32a31179b2e/digital_experiments-2.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9ef3c44483773315df9637bbd72404652403a15fa618833b6c67114a96a00101",
                "md5": "50e6614a57d95cbba1ee88e9670c9ffc",
                "sha256": "8d56ededcf3dfbfb71e73e9dc265f7d455eeefa4b5c8dfa521602645d91a5ba8"
            },
            "downloads": -1,
            "filename": "digital-experiments-2.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "50e6614a57d95cbba1ee88e9670c9ffc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 16483,
            "upload_time": "2024-02-24T12:24:28",
            "upload_time_iso_8601": "2024-02-24T12:24:28.022840Z",
            "url": "https://files.pythonhosted.org/packages/9e/f3/c44483773315df9637bbd72404652403a15fa618833b6c67114a96a00101/digital-experiments-2.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-24 12:24:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jla-gardner",
    "github_project": "digital-experiments",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "digital-experiments"
}
        
Elapsed time: 0.68883s