Skip to main content

Companion library for the HAXR dataset

Project description

DOI Python 3.11 PyPI CI Ruff

[Documentation 📚]

haxr

haxr is the companion library for the HAXR dataset. It is an easy-to-use, local-cache-based access layer for the dataset files and a collection of handy utilities for working with the data.

haxr releases are available as wheel packages for macOS, Windows and Linux on PyPI. Install it using pip:

pip install haxr

and find the documentation of the API here.

As a teaser, here is an example that plots the 1000th cycle of amerikahoeft_08-UTC.hdf:

import haxr
import matplotlib.pyplot as plt


def plot_cycle(store, station, split_hour_utc, cycle, file_name="demo.png"):
    chunk = store.get_chunk(station=station, split_hour_utc=split_hour_utc)
    with store.open(chunk.radar_file) as f:
        df = haxr.utilities.load_cycle(f, cycle)
        h, az_edges, r_edges = haxr.utilities.fill_histogram(
            az=df["az (degree)"], r=df["r (meter)"], weights=df["amp"]
        )
        x, y, v = haxr.utilities.histogram_to_cartesian_meshgrid(h, az_edges, r_edges)

    fig, ax = plt.subplots(figsize=(3, 3))
    ax.pcolormesh(x, y, v, cmap="plasma")
    ax.set_aspect("equal")
    ax.set_axis_off()

    fig.savefig(file_name, dpi=300)


with haxr.Store(base_url=haxr.DOI.latest) as store:
    plot_cycle(store, "amerikahoeft", split_hour_utc=8, cycle=1000)
demo.png

Contributing 👷

Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to submit a pull request.

As a rule of thumb:

  • For bugs and feature requests, please open a GitHub issue.
  • For changes, please open a pull request.
  • Small, focused PRs are easiest to review.
  • Improvements for tests and doc are highly appreciated.

Development Setup

Clone the repository and set up a development environment. The project defines dependency groups (see pyproject.toml), including a dev group for development tools and a docs group for building the documentation.

Option A: uv (recommended)

git clone https://github.com/DLR-KN/haxr
cd haxr
uv sync --all-groups

If you only need the documentation toolchain:

uv sync --group docs

Option B: pip + venv

git clone https://github.com/DLR-KN/haxr
cd haxr
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e . --group dev --group docs

Pre-commit Hooks

To maintain code quality and avoid pushing invalid commits, we recommend using pre-commit hooks. These hooks perform automated checks before commits are made. To set up pre-commit hooks (part of the dev group), follow these steps:

pre-commit install

Optionally, run the hooks once on all files:

pre-commit run --all-files

Tests

We use pytest to orchestrate our tests. Run all tests via

uv run pytest

or, in a plain venv,

python -m pytest

Make sure to run tests before submitting a pull request to ensure that everything is functioning as expected.

Generate Documentation (optional)

We use Sphinx to automatically build the project documentation from the source tree and the docstrings in the codebase. All documentation-specific dependencies are bundled in the uv dependency group docs, so you can easily install them via

uv sync --group docs

Then, build the HTML docs:

uv run --group docs make -C docs html

and open docs/build/html/index.html in your browser.

Publishing to PyPI (maintainers)

This project uses uv to build and publish distributions manually (not part of the CI).

Build the sdist and wheel into dist/:

rm -rf dist/
uv build

and publish the artifacts in dist/ to PyPI:

uv publish

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

haxr-1.1.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

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

haxr-1.1.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file haxr-1.1.0.tar.gz.

File metadata

  • Download URL: haxr-1.1.0.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.18

File hashes

Hashes for haxr-1.1.0.tar.gz
Algorithm Hash digest
SHA256 9ecc56eb62137aed0699b36943109628592cfa74d66ec2b2c3cab7bac8d85396
MD5 140a7d98f744b3104daa824b67a7e05a
BLAKE2b-256 c222666ece7b43c5d82ff5e8bc1ae96b728a9941b7dcd7feb66f30dc072a3304

See more details on using hashes here.

File details

Details for the file haxr-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: haxr-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.18

File hashes

Hashes for haxr-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6767c476c2ae8a986fde7e636552a8756074fc8f0452c965868be7a63c73a2f0
MD5 6916f861c30aff7fdaf03a98bbaff862
BLAKE2b-256 624271a4772e48584ad174d4e7bf6c4427c381c63893f07e2a55364f8a5daa60

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