Skip to content

High-level Pythonic API: generated enums, validation, and numpy/pandas/matplotlib helpers #132

Description

@grzanka

Part of #130. Builds on the nanobind core (companion issue) and complements #117/#114.

Context

The nanobind core exposes the raw C API. On top of it we want a friendly, idiomatic Python layer so that examples and notebooks read naturally (e.g. Program.PSTAR, Material.WATER) and users never pass magic integers. This is the layer the user docs/notebooks (companion docs issue) are written against.

Proposed change

Acceptance criteria

  • Generated Program/Ion/Material enums with a CI drift-guard against the C headers.
  • LibdedxError with code→message mapping; consistent raise-on-error across the API.
  • Input validation prevents segfaults on invalid combinations/energies (tested).
  • numpy in/out core; optional pandas + matplotlib helpers under extras, lazily imported.
  • Public API documented with NumPy-style docstrings (consumed by the docs issue).

References

Relates to #117, #114, #120, #110, #51, #79.


Filed via Claude Code (model: Claude Opus 4.8) as part of the libdedx → libamtrack integration & Python-packaging plan.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions