Skip to content

Edge case for "none" unit conversions #567

@peverwhee

Description

@peverwhee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugFor issues describing bugs, or PRs fixing bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions