usnistgov / PyHyperScattering

Tools for hyperspectral x-ray and neutron scattering data loading, reduction, slicing, and visualization.
Other
7 stars 9 forks source link

refactor: replace dictionaries of parameters with bespoke Dataclasses or Pydantic objects #98

Open pbeaucage opened 1 year ago

pbeaucage commented 1 year ago

At several points in PyHyper, most notably integration parameters, opaque dictionaries of flexible parameters are used to switch between several different methods, e.g. Nika vs PyFAI geometries.

It would be more robust and usable if these were replaced with a Dataclass that validated complete inputs and provided state management for the integrator.

Other than a discussion item, the main to-do is find other examples where we use dictionaries of parameters to consider conversion.