Summary
FitConfig defines six optional integer fields that map to SAMMY Card Set 2 parameters, but none have validation constraints:
iptdop: Optional[int] = Field(default=None, description="Grid enhancement for Doppler broadening")
iptwid: Optional[int] = Field(default=None, description="Grid enhancement for resonance tails")
ixxchn: Optional[int] = Field(default=None, description="Special channel skip or ENDF ZA")
ndigit: Optional[int] = Field(default=None, description="Digits for compact covariance output")
idropp: Optional[int] = Field(default=None, description="Percent threshold for zeroing covariances")
matnum: Optional[int] = Field(default=None, description="ENDF material number")
Currently any integer value is accepted. Invalid values are only caught when SAMMY runs, which gives poor error messages and wastes compute time.
Suggested Approach
- Cross-reference the SAMMY manual for each field's valid range and semantics
- Add appropriate Pydantic constraints (e.g.,
ge=0, le=100, Literal for enumerated values)
- Add unit tests verifying that out-of-range values are rejected at config construction time
Location
src/pleiades/sammy/fitting/config.py, lines 31-40
Context
Identified during review of PR #220. Not a blocker — None defaults mean SAMMY's own defaults are used, and SAMMY will reject truly invalid values at runtime. But early validation would improve the user experience.
Related
Summary
FitConfigdefines six optional integer fields that map to SAMMY Card Set 2 parameters, but none have validation constraints:Currently any integer value is accepted. Invalid values are only caught when SAMMY runs, which gives poor error messages and wastes compute time.
Suggested Approach
ge=0,le=100,Literalfor enumerated values)Location
src/pleiades/sammy/fitting/config.py, lines 31-40Context
Identified during review of PR #220. Not a blocker —
Nonedefaults mean SAMMY's own defaults are used, and SAMMY will reject truly invalid values at runtime. But early validation would improve the user experience.Related