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.
- Combining Sweeps: Run multiple different sweeps together with a shared pool of workers using
SweepGroup. - 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:
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.
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
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
License
SweepExp is licensed under the MIT License. See LICENSE for more information.
Metadata
Release files for sweepexp 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sweepexp-1.2.0.tar.gz | 45.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sweepexp-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 76.1 kB
Release files / sweepexp-1.2.0.tar.gz
| Download URL | sweepexp-1.2.0.tar.gz |
|---|---|
| Size | 45.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3370e276f88e9bc232b0143738d6e37c904f6a97cf6f1bec28ad8fa9a41adcdc
|
|
BLAKE2b-256 checksum How to use checksums |
c4e87e07fa18a90fc8894c8dc0ca1d72440737c372d104b7a8c9810ccb83af95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.
Transparency logRelease files / sweepexp-1.2.0-py3-none-any.whl
| Download URL | sweepexp-1.2.0-py3-none-any.whl |
|---|---|
| Size | 30.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c59aa715390f72aa3cc0ee6135c580761fd9958c1792c166fca7bb266a1f0e8
|
|
BLAKE2b-256 checksum How to use checksums |
2ca2aa44efdbb4581b8c2b0b7b41dbb015d17adfc3b8487f98850fc9a1ccb6fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.
Transparency log