sweepexp


Namesweepexp JSON
Version 1.1.1 PyPI version JSON
download
home_pageNone
SummaryA python package for running parallel experiments across parameter grids with MPI.
upload_time2025-08-10 18:35:57
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2025, Silvano Gordian Rosenau 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
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Read the Docs](https://img.shields.io/readthedocs/sweepexp)
![tests](https://github.com/Gordi42/sweepexp/actions/workflows/test.yml/badge.svg)
[![codecov](https://codecov.io/github/Gordi42/sweepexp/graph/badge.svg?token=SHVDIIOL8Y)](https://codecov.io/github/Gordi42/sweepexp)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
![GitHub License](https://img.shields.io/github/license/Gordi42/sweepexp)
[![DOI](https://zenodo.org/badge/921273341.svg)](https://doi.org/10.5281/zenodo.14779187)

<p align="center">
<img src="docs/source/_static/sweepexp_logo.png?raw=true">
</p>

A python package for running parallel experiments across parameter grids with MPI.

## Features

- **Flexible Experimentation with Parameter Grids:** SweepExp simplifies running experiments over a grid of parameter combinations. Results are stored in an xarray dataset for easy access and analysis.
- **Parallelization:** Support for parallelization using multiprocessing, or MPI for high-performance computing.
- **User-Friendly API:**  Define the function to be tested, set up parameter sweeps, and specify return types effortlessly.

## Installation

SweepExp can be installed via pip:

```bash
pip install sweepexp
```

## Usage
The followin example shows how to setup a simple experiment that is run on a grid of parameters. Where each parameter combination is run in parallel on separate processes. 

```python

from sweepexp import SweepExpParallel

# Define a function to be tested
def my_custom_experiment(x: float, y: float) -> dict:
    """Add and multiply two numbers."""
    return {"addition": x + y, "multiplication": x * y}

sweep = SweepExpParallel(
    func = my_custom_experiment,
    parameters = { "x": [1, 2], "y": [3, 4, 5] },
)

sweep.run()

print(sweep.data)
```

with the output:
```
<xarray.Dataset> Size: 160B
Dimensions:         (x: 2, y: 3)
Coordinates:
    * x               (x) int64 16B 1 2
    * y               (y) int64 24B 3 4 5
Data variables:
    status          (x, y) <U1 24B 'C' 'C' 'C' 'C' 'C' 'C'
    addition        (x, y) float64 48B 4.0 5.0 6.0 5.0 6.0 7.0
    multiplication  (x, y) float64 48B 3.0 4.0 5.0 6.0 8.0 10.0
```

For more information on how to use the package, please refer to the [documentation](https://sweepexp.readthedocs.io/)

## How to cite

```
@software{Rosenau_sweepexp_2025,
          author = {Rosenau, Silvano Gordian},
          doi = {10.5281/zenodo.14779187},
          month = jan,
          title = {{SweepExp: A python package for running parallel experiments across parameter grids.}},
          url = {https://github.com/Gordi42/sweepexp},
          version = {1.0.2},
          year = {2025}
}
```

## Author
- [Silvano Gordian Rosenau](silvano.rosenau@uni-hamburg.de)

## License
SweepExp is licensed under the MIT License. See [LICENSE](LICENSE) for more information.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sweepexp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Silvano Gordian Rosenau <silvano.rosenau@uni-hamburg.de>",
    "download_url": "https://files.pythonhosted.org/packages/0d/72/0b8fbe0e8ce49b650905b49f62af962d236c36d3fd52e4a78a155d550ec6/sweepexp-1.1.1.tar.gz",
    "platform": null,
    "description": "![Read the Docs](https://img.shields.io/readthedocs/sweepexp)\n![tests](https://github.com/Gordi42/sweepexp/actions/workflows/test.yml/badge.svg)\n[![codecov](https://codecov.io/github/Gordi42/sweepexp/graph/badge.svg?token=SHVDIIOL8Y)](https://codecov.io/github/Gordi42/sweepexp)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n![GitHub License](https://img.shields.io/github/license/Gordi42/sweepexp)\n[![DOI](https://zenodo.org/badge/921273341.svg)](https://doi.org/10.5281/zenodo.14779187)\n\n<p align=\"center\">\n<img src=\"docs/source/_static/sweepexp_logo.png?raw=true\">\n</p>\n\nA python package for running parallel experiments across parameter grids with MPI.\n\n## Features\n\n- **Flexible Experimentation with Parameter Grids:** SweepExp simplifies running experiments over a grid of parameter combinations. Results are stored in an xarray dataset for easy access and analysis.\n- **Parallelization:** Support for parallelization using multiprocessing, or MPI for high-performance computing.\n- **User-Friendly API:**  Define the function to be tested, set up parameter sweeps, and specify return types effortlessly.\n\n## Installation\n\nSweepExp can be installed via pip:\n\n```bash\npip install sweepexp\n```\n\n## Usage\nThe followin example shows how to setup a simple experiment that is run on a grid of parameters. Where each parameter combination is run in parallel on separate processes. \n\n```python\n\nfrom sweepexp import SweepExpParallel\n\n# Define a function to be tested\ndef my_custom_experiment(x: float, y: float) -> dict:\n    \"\"\"Add and multiply two numbers.\"\"\"\n    return {\"addition\": x + y, \"multiplication\": x * y}\n\nsweep = SweepExpParallel(\n    func = my_custom_experiment,\n    parameters = { \"x\": [1, 2], \"y\": [3, 4, 5] },\n)\n\nsweep.run()\n\nprint(sweep.data)\n```\n\nwith the output:\n```\n<xarray.Dataset> Size: 160B\nDimensions:         (x: 2, y: 3)\nCoordinates:\n    * x               (x) int64 16B 1 2\n    * y               (y) int64 24B 3 4 5\nData variables:\n    status          (x, y) <U1 24B 'C' 'C' 'C' 'C' 'C' 'C'\n    addition        (x, y) float64 48B 4.0 5.0 6.0 5.0 6.0 7.0\n    multiplication  (x, y) float64 48B 3.0 4.0 5.0 6.0 8.0 10.0\n```\n\nFor more information on how to use the package, please refer to the [documentation](https://sweepexp.readthedocs.io/)\n\n## How to cite\n\n```\n@software{Rosenau_sweepexp_2025,\n          author = {Rosenau, Silvano Gordian},\n          doi = {10.5281/zenodo.14779187},\n          month = jan,\n          title = {{SweepExp: A python package for running parallel experiments across parameter grids.}},\n          url = {https://github.com/Gordi42/sweepexp},\n          version = {1.0.2},\n          year = {2025}\n}\n```\n\n## Author\n- [Silvano Gordian Rosenau](silvano.rosenau@uni-hamburg.de)\n\n## License\nSweepExp is licensed under the MIT License. See [LICENSE](LICENSE) for more information.\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025, Silvano Gordian Rosenau\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "A python package for running parallel experiments across parameter grids with MPI.",
    "version": "1.1.1",
    "project_urls": {
        "Repository": "https://github.com/Gordi42/sweepexp"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fd8bf765804783aa93067726855b7b1de9463801657c37f660753ce1ccdac0d2",
                "md5": "594ccc4cc37ef0276437001d2310d73c",
                "sha256": "231138ae756d714a579e3c0c3c2981abbea406f61a8c7b7d0e4e06fcc89597ef"
            },
            "downloads": -1,
            "filename": "sweepexp-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "594ccc4cc37ef0276437001d2310d73c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 21069,
            "upload_time": "2025-08-10T18:35:56",
            "upload_time_iso_8601": "2025-08-10T18:35:56.234509Z",
            "url": "https://files.pythonhosted.org/packages/fd/8b/f765804783aa93067726855b7b1de9463801657c37f660753ce1ccdac0d2/sweepexp-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0d720b8fbe0e8ce49b650905b49f62af962d236c36d3fd52e4a78a155d550ec6",
                "md5": "f73379370399956e786ae7db028bafe6",
                "sha256": "991ac44f538a27a71ad5ad0b80b0de72490db93708855c2a43017403be532835"
            },
            "downloads": -1,
            "filename": "sweepexp-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f73379370399956e786ae7db028bafe6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 32205,
            "upload_time": "2025-08-10T18:35:57",
            "upload_time_iso_8601": "2025-08-10T18:35:57.722973Z",
            "url": "https://files.pythonhosted.org/packages/0d/72/0b8fbe0e8ce49b650905b49f62af962d236c36d3fd52e4a78a155d550ec6/sweepexp-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-10 18:35:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Gordi42",
    "github_project": "sweepexp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sweepexp"
}
        
Elapsed time: 0.64011s