NCAR/ccpp-framework

Edge case for "none" unit conversions

Closed this issue · 1 comments

Description

If a unit conversion involves "none", we get an error because "none" is a python keyword.

Steps to Reproduce

Using head of main, change the units for one instance of errmsg in one of the tests from "none" to "None"

Additional Context

We should have logic that can handle this, meaning:

  1. For "none" unit only, convert to lower case before comparing (to handle case differences)
  2. An exception to the "no python keywords allowed" rule for "none"? - so that if a user tries to convert "1" to "none" or something, they'll get a more helpful error.

Output

Error:

Invalid units entry, 'None', Python identifier, at...

Source of error: scripts/var_props.py", line 1172, in _get_unit_convstrs

fixed in #583