aind-data-schema icon indicating copy to clipboard operation
aind-data-schema copied to clipboard

Convert all optional values with required units to have both optional value and value_unit, enforce their state with a global validator

Open dbirman opened this issue 5 months ago • 1 comments

User story

As a user I want to be able to build models that don't have required units when their corresponding value is set to None.

To do this, we can make both values and their corresponding unit have semantically matched names value and value_unit and then use a global validator to ensure the units are set if the value is set.

The only catch with this is that some units are matched to multiple values and need to be set if any of the matched values are set -- one option would be to separate the values with underscores (value1_value2_value3_unit). Bit ugly?

Acceptance criteria

  • [ ] All optional variables with required units are now both optional
  • [ ] Setting an optional variable w/ units throws an error if the unit is not also set
  • [ ] Tests

dbirman avatar Oct 03 '24 20:10 dbirman