Skip to main content

Simple grid search utility that returns xarray outputs.

Project description

xarray-sweep

Small utility to run a function over a Cartesian product of parameters and return results as an unstacked xarray object.

Install

pip install xarray-sweep

For local development:

python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]

Usage

import xarray as xr
from xarray_sweep import xarray_sweep


def model(a: float, b: float):
    return a + b

out = xarray_sweep(model, a=[0.1, 0.2], b=[1.0, 2.0])
print(out)

Run tests

pytest

Build distribution artifacts

python -m build

Publish to PyPI

  1. Create a PyPI account and API token.
  2. Build artifacts (python -m build).
  3. Upload with Twine:
twine upload dist/*

For TestPyPI first:

twine upload --repository testpypi dist/*

GitHub Actions CI

A workflow is included at .github/workflows/ci.yml that runs tests on pull requests and pushes to main.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xarray_sweep-0.1.5.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xarray_sweep-0.1.5-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file xarray_sweep-0.1.5.tar.gz.

File metadata

  • Download URL: xarray_sweep-0.1.5.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for xarray_sweep-0.1.5.tar.gz
Algorithm Hash digest
SHA256 17dedd1425e0a9e32a9b829f5bd67ef81e38e5073eda06f8e80b1a3a9bef9f6a
MD5 88740b212344400ac88fb201793a40c8
BLAKE2b-256 c3379e2b8834ed3787e62d1a445ab64b65b305d616a7ae7891e02fe97a41a153

See more details on using hashes here.

File details

Details for the file xarray_sweep-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: xarray_sweep-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for xarray_sweep-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f32036d4c3abc112a460110773c8e2f48a96325378ade8916a477232874b55c2
MD5 4b8ad03ce5feda8245d5303ce588c1c3
BLAKE2b-256 a50180b74b50f0cfb5cda310d72c7f7bd2572cf507cc2ae11b5622e271c9e47f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page