Skip to content

Conversation

@FibrinLab
Copy link

Fixes issue: mid-parental-height accepts impossible values #53

  • Add MAXIMUM_PARENTAL_HEIGHT_CM constant (260 cm) to validation_constants.py
  • Add comprehensive input validation to mid_parental_height() function
  • Add input validation to mid_parental_height_z() function
  • Add 7 new test functions covering all validation scenarios

- Add MAXIMUM_PARENTAL_HEIGHT_CM constant (260 cm) to validation_constants.py
- Add comprehensive input validation to mid_parental_height() function:
  * Validate sex parameter (must be 'male' or 'female')
  * Validate maternal_height (None, type, range 50-260 cm)
  * Validate paternal_height (None, type, range 50-260 cm)
- Add comprehensive input validation to mid_parental_height_z() function:
  * Validate reference parameter
  * Validate maternal_height (None, type, range 50-260 cm)
  * Validate paternal_height (None, type, range 50-260 cm)
- Add 7 new test functions covering all validation scenarios
- All tests pass (22,767 total tests)

Fixes issue: mid-parental-height accepts impossible values
@mbarton mbarton self-assigned this Jan 26, 2026
@mbarton
Copy link
Member

mbarton commented Jan 26, 2026

Thanks for the contribution @FibrinLab! It looks fine from a code point of view however we will need to run this past the statisticians who advise us before merging. Hopefully won't take too long :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants