fix: validate mid-parental height inputs - #107
Merged
Merged
Conversation
Recreated from PR #78 by Dr Akanimoh Osutuk, with the stale notebook changes omitted. Validate types, finite values, reference and sex, and reject parental heights outside the established SDS error limits. Co-authored-by: Marcus Baw <marcus@marcusbaw.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Recreates and updates the validation contributed by Dr Akanimoh Osutuk (@FibrinLab) in #78 on a clean branch from current
live.None, booleans, non-numeric values, and non-finite values with clearValueErrormessages.sexandreferencevalues explicitly.The stale
Quickstart.ipynbruntime-output changes and the unused absolute maximum-height constant from the original branch are intentionally omitted.API compatibility
This does not change valid API output. The API server currently computes the same parental-height SDS values and rejects values outside -8 to +8 SDS before calling
mid_parental_height_z(). Valid requests therefore reach the same calculation with unchanged output. This package-level validation protects direct Python consumers and provides the same guard at the source.Attribution
The implementation commit retains
FibrinLab <fibrinlab@gmail.com>as its author and includes Marcus Baw as co-author for the current-tree recreation and refinements. The separate documentation attribution is in rcpch/digital-growth-charts-documentation#184.Supersedes #78.
Closes #53.
Verification
s/test --running -q: 145151 passedgit diff --check: passed