Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional check that units for linked variables match #129

Merged
merged 1 commit into from
Jun 20, 2024
Merged

Conversation

sjdaines
Copy link
Member

  • 'allocate_variables!' add 'check_units_opt' keyword, with allowed values: :no - (default) no check :warn - check that units for linked variables match (ie all variables linked together have the same units) :error - check and error if mismatch found

  • units="unknown" is a magic value that means 'don't check this variable', units="" is convention for dimensionless value.

  • fix some bugs where units were missing

  • set units="unknown" for generic reactions (eg ReactionForceGrid) where the units are not known. NB: units attribute can be set in the yaml file if needed, to reenable checks.

- 'allocate_variables!' add 'check_units_opt' keyword, with allowed values:
    :no  - (default) no check
    :warn - check that units for linked variables match (ie all variables linked together have the same units)
    :error - check and error if mismatch found

- units="unknown" is a magic value that means 'don't check this variable', units="" is convention for
  dimensionless value.

- fix some bugs where units were missing

- set units="unknown" for generic reactions (eg ReactionForceGrid) where the units are not known.
  NB: units attribute can be set in the yaml file if needed, to reenable checks.
@sjdaines sjdaines changed the title Add option to check units for linked variables Add optional check that units for linked variables match Jun 20, 2024
@sjdaines sjdaines merged commit b0598ac into main Jun 20, 2024
3 checks passed
@sjdaines sjdaines deleted the check_units branch June 20, 2024 15:28
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.

1 participant