Reject masked shared random parameters - #4964
Conversation
✅MegaLinter analysis: Success
Notices📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining See detailed reports in MegaLinter artifacts Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
|
Closing as low value. This expands masked-array rejection across shared random-distribution parameters, but masked arrays are not a supported cross-backend sampling contract in PyRecEst. Adding piecemeal validation here would increase inconsistency rather than establish coherent missing-data behavior. |

Summary
asarraychoiceprobabilitiesMaskedArrayvaluesRoot cause
The shared validators converted inputs with
asarraybefore checking NumPy mask semantics. For a masked scalar or partially masked array, that conversion exposes the hidden data payload and discards the mask. Missing configuration values could therefore become real sampling parameters.Examples include a masked normal scale being silently used as its hidden standard deviation and a masked
choiceprobability being normalized and sampled from.Impact
NumPy and Autograd backend samplers now fail early instead of drawing reproducible-looking samples from missing data. The earlier masked-input fix for NumPy
randintandmultinomialdid not cover these shared distribution samplers.Validation
asarraymain