Name | raxpy JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | Python library that designs and executes experiments on Python functions, enabling rapid experimentation. |
upload_time | 2025-01-06 18:14:27 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2024 Neil Ranly 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 |
experimentation
synthetic data
design of experiment
model specification
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# raxpy, Python library to rapidly design and execute experiments
| | |
|---|---|
| Testing | [![CI - Test](https://github.com/neil-r/raxpy/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/neil-r/raxpy/actions/workflows/unit_tests.yml) ![Code Coverage](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fneil-r%2Fraxpy%2Fmain%2Fcoverage.json%3Ftoken%3DGHSAT0AAAAAACUX5ZW2YBA4DDCOU27KJPKSZVKMFCA&query=%24.totals.percent_covered_display&suffix=%25&label=Code%20Coverage&color=Green) |
| Meta | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/neil-r/raxpy/blob/main/LICENSE)
## Description
raxpy is a Python library that designs and executes experiments on Python annotated functions. Given a Python function provided by the user, raxpy introspects the function signature to derive an experiment input-space. With a function's derived input-space, raxpy utilizes different experiment design algorithms to create a small set of function arguments, i.e., the design points, that attempt to cover the whole input-space. With the experiment design, raxpy maps the design points to the function's arguments to execute the function with each point.
To address limitations in factorial and random point selection algorithms, raxpy provide space-filling design algorithms to generate insightful results from a small number of function executions. For more information, see .
## Usage
1. Install raxpy if not already installed.
2. Import raxpy and typing Annotation
3. Create a annotated function that is to be the subject of experimentation
```python
from typing import Annotated
import raxpy
def f(
age:Annotated[float, raxpy.Float(label="Age", lb=20.0, ub=80.0)],
bmi:Annotated[float, raxpy.Float(label="BMI", lb=18.0, ub=40.0)],
blood_pressure:Annotated[float, raxpy.Float(label="Blood Pressure", lb=90.0, ub=180.0)]
)-> float:
glucose_factor = 0 if glucose is None else (glucose - 70) / (200 - 70)
cholesterol_factor = 0 if cholesterol is None else (cholesterol - 150) / (300 - 150)
my_calc = (
(age / 80) +
((bmi - 18) / (40 - 18)) +
((blood_pressure - 90) / (180 - 90)) +
(glucose_factor) +
(cholesterol_factor) -
(physical_activity / 2)
)
return bmi_level
```
4. Run experiment
```python
inputs, outputs = raxpy.perform_experiment(f, n_points=10)
```
See examples folder for more usage examples.
## Features
raxpy can execute experiments on functions with the following types of parameters:
- float types
- int types
- str (categorical) types
- Optional, None types
- Hierarchical types based on dataclasses
- Union types
### Experiment Design Algorithm Support
raxpy provides extended versions of the following algorithms to support optional, hierarchical, and union typed inputs. The space-filling designs work best for exploration use cases when function executions are highly constrained by time and compute resources. Random designs work best when the function needs executed to support the creation of a very large dataset.
- Space-filling MaxPro
- Space-filling Uniform (using scipy)
- Random
## Installation
raxpy requires numpy and scipy. To install with pip, execute
```
pip install raxpy
```
To execute distributed experiments with MPI, also ensure you have the appropriate MPI cluster and install mpi4py.
## Support
For community support, please use GitHub issues.
## Roadmap
### Version 1.0
- Refine and test configspace adapter with hyper-parameter optimization algorithms
### Version x.x
The following elements are being considered for development but not scheduled.
- Auto-generated data schema and databases
- Advanced trial meta-data features (point ids, run-time, status, etc.)
- Adaptive experimentation algorithms
- Response surface methodology
- Sequential design algorithms
- Support of more input-space constraint types
- Mixture constraints
- Multi-dimensional linear constraints
- Surrogate optimization features
- Trial artifact management
## Contributing
This project is open for new contributions. Contributions should follow the coding style as evident in codebase and be unit-tested. New dependencies should mostly be avoided; one exception is the creation of a new adapter, such as creating an adapter to use raxpy with an optimization library.
## Citing
If you used raxpy to support your academic research, please cite:
```
```
## Project status
raxpy is being actively developed as of 2025-01-01.
Raw data
{
"_id": null,
"home_page": null,
"name": "raxpy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "experimentation, synthetic data, design of experiment, model specification",
"author": null,
"author_email": "Neil Ranly <neil.ranly@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/30/e3/4fd532f6f7e05dc05d6efbf096184699aaeef8e28c9fe4f82d6af0d56ad1/raxpy-0.1.1.tar.gz",
"platform": null,
"description": "# raxpy, Python library to rapidly design and execute experiments\n| | |\n|---|---|\n| Testing | [![CI - Test](https://github.com/neil-r/raxpy/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/neil-r/raxpy/actions/workflows/unit_tests.yml) ![Code Coverage](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fneil-r%2Fraxpy%2Fmain%2Fcoverage.json%3Ftoken%3DGHSAT0AAAAAACUX5ZW2YBA4DDCOU27KJPKSZVKMFCA&query=%24.totals.percent_covered_display&suffix=%25&label=Code%20Coverage&color=Green) |\n| Meta | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/neil-r/raxpy/blob/main/LICENSE)\n\n## Description\nraxpy is a Python library that designs and executes experiments on Python annotated functions. Given a Python function provided by the user, raxpy introspects the function signature to derive an experiment input-space. With a function's derived input-space, raxpy utilizes different experiment design algorithms to create a small set of function arguments, i.e., the design points, that attempt to cover the whole input-space. With the experiment design, raxpy maps the design points to the function's arguments to execute the function with each point. \n\nTo address limitations in factorial and random point selection algorithms, raxpy provide space-filling design algorithms to generate insightful results from a small number of function executions. For more information, see .\n\n## Usage\n\n 1. Install raxpy if not already installed.\n 2. Import raxpy and typing Annotation\n 3. Create a annotated function that is to be the subject of experimentation \n\n```python\nfrom typing import Annotated\nimport raxpy\n\n\ndef f(\n age:Annotated[float, raxpy.Float(label=\"Age\", lb=20.0, ub=80.0)],\n bmi:Annotated[float, raxpy.Float(label=\"BMI\", lb=18.0, ub=40.0)],\n blood_pressure:Annotated[float, raxpy.Float(label=\"Blood Pressure\", lb=90.0, ub=180.0)]\n)-> float:\n \n glucose_factor = 0 if glucose is None else (glucose - 70) / (200 - 70)\n cholesterol_factor = 0 if cholesterol is None else (cholesterol - 150) / (300 - 150)\n\n my_calc = (\n (age / 80) +\n ((bmi - 18) / (40 - 18)) +\n ((blood_pressure - 90) / (180 - 90)) +\n (glucose_factor) +\n (cholesterol_factor) -\n (physical_activity / 2)\n )\n\n return bmi_level\n```\n 4. Run experiment \n \n```python\ninputs, outputs = raxpy.perform_experiment(f, n_points=10)\n```\n\nSee examples folder for more usage examples.\n\n## Features\n\nraxpy can execute experiments on functions with the following types of parameters:\n- float types\n- int types\n- str (categorical) types\n- Optional, None types \n- Hierarchical types based on dataclasses\n- Union types\n\n### Experiment Design Algorithm Support\n\nraxpy provides extended versions of the following algorithms to support optional, hierarchical, and union typed inputs. The space-filling designs work best for exploration use cases when function executions are highly constrained by time and compute resources. Random designs work best when the function needs executed to support the creation of a very large dataset.\n\n - Space-filling MaxPro\n - Space-filling Uniform (using scipy)\n - Random\n\n## Installation\n\nraxpy requires numpy and scipy. To install with pip, execute\n\n```\npip install raxpy\n```\n\nTo execute distributed experiments with MPI, also ensure you have the appropriate MPI cluster and install mpi4py. \n\n## Support\n\nFor community support, please use GitHub issues. \n\n## Roadmap\n\n### Version 1.0\n\n- Refine and test configspace adapter with hyper-parameter optimization algorithms\n\n### Version x.x\n\nThe following elements are being considered for development but not scheduled. \n\n- Auto-generated data schema and databases\n- Advanced trial meta-data features (point ids, run-time, status, etc.)\n- Adaptive experimentation algorithms\n - Response surface methodology\n - Sequential design algorithms\n - Support of more input-space constraint types\n - Mixture constraints\n - Multi-dimensional linear constraints\n- Surrogate optimization features\n- Trial artifact management\n\n## Contributing\nThis project is open for new contributions. Contributions should follow the coding style as evident in codebase and be unit-tested. New dependencies should mostly be avoided; one exception is the creation of a new adapter, such as creating an adapter to use raxpy with an optimization library.\n\n## Citing\n\nIf you used raxpy to support your academic research, please cite:\n\n```\n\n```\n\n## Project status\n\nraxpy is being actively developed as of 2025-01-01.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Neil Ranly 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": "Python library that designs and executes experiments on Python functions, enabling rapid experimentation.",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [
"experimentation",
" synthetic data",
" design of experiment",
" model specification"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3dbc0fc9b5bbecd3c2bd6b5f9c829efd1758f5759e3af14d3b69820c31f52c8b",
"md5": "242c662fad0e6b47f348c689b56793ba",
"sha256": "fb463acb87fd2f100ead1124783d82932520eea4756a2295c30f53699e1a8eb0"
},
"downloads": -1,
"filename": "raxpy-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "242c662fad0e6b47f348c689b56793ba",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 52664,
"upload_time": "2025-01-06T18:14:26",
"upload_time_iso_8601": "2025-01-06T18:14:26.196142Z",
"url": "https://files.pythonhosted.org/packages/3d/bc/0fc9b5bbecd3c2bd6b5f9c829efd1758f5759e3af14d3b69820c31f52c8b/raxpy-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "30e34fd532f6f7e05dc05d6efbf096184699aaeef8e28c9fe4f82d6af0d56ad1",
"md5": "6308982874879c8cb61927dc4eae57b8",
"sha256": "212307b786249da95eebee351c63917c5b1bb59a17728a0b068abf1921bf02da"
},
"downloads": -1,
"filename": "raxpy-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "6308982874879c8cb61927dc4eae57b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 83820,
"upload_time": "2025-01-06T18:14:27",
"upload_time_iso_8601": "2025-01-06T18:14:27.737605Z",
"url": "https://files.pythonhosted.org/packages/30/e3/4fd532f6f7e05dc05d6efbf096184699aaeef8e28c9fe4f82d6af0d56ad1/raxpy-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-06 18:14:27",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "raxpy"
}