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.2.0.tar.gz (15.2 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.2.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for haxr-1.2.0.tar.gz
Algorithm Hash digest
SHA256 6cecb0f1c33a450ee13af66daaf8a63ee665fcc9e2e8ef4645678abd2967e1ab
MD5 82f55f51f9137aa57ba9dd64490a1410
BLAKE2b-256 c41c5e549fc36d44366cb579ac044c53fcf146b4c63a8cb57c4fc8ef2312c8e6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for haxr-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd1a15b2f04767a3ed5b6328b108ee52f5cc73fb49111fb389bd24c088d45d2f
MD5 e2e2cd9add1b90066aeb08a51adfac8e
BLAKE2b-256 4998429f79dd28d6344dffb08e9f38a7f3cd1537aed1ce0930445918d4f232c2

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