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
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.
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
Program,Ion,Material(IntEnum) generated from the C headers (src/dedx_program_const.h,include/dedx_elements.h) by a small generator + a drift test in CI — never hand-copied. ProvideMaterial.from_name(...)/.label(ties into refactor: replace program/target/ion magic numbers with named constants #114 and display names Add public dedx_get_material_display_name() and make C the single source of truth for display names #120).LibdedxErrormapping numeric codes fromdedx_error.hto readable messages; raise on non-zero*err.numpyarrays out (stopping power, CSDA, inverse).libdedx[pandas]→ tidyDataFrametables;libdedx[plot]→matplotlibconvenience plots;libdedx[all].Acceptance criteria
Program/Ion/Materialenums with a CI drift-guard against the C headers.LibdedxErrorwith code→message mapping; consistent raise-on-error across the API.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.