Adds optional m_minus parameter (bool, defaults to True) to make_number(), as well as logic changes, to allow for generic parsing of prefixes 'M' as "less than" and 'P' as "greater than" without breaking existing 'M' as "-" logic.
Adds optional speak_prefix parameter (str, defaults to "") to make_fraction() to allow make_number() to determine "greater than" or "less than" prefix on a fractional value.
Removes static mappings for strings that utilize these prefixes.
Updates get_wind() and get_visibility() to set m_minus=False in calls to make_number().
Splits test_make_number() parameters that require m_minus=False into a separate test.
Sets m_minus=False in a few other unit tests that call make_number() for visibility/cloud strings.
Very open to feedback on this implementation, but existing unit tests are all passing with only very minor updates.
Checklist
[x] Tests covering the new functionality have been added
[x] Documentation has been updated OR the change is too minor to be documented
[x] Changes are listed in the CHANGELOG.md OR changes are insignificant
Description
m_minus
parameter (bool, defaults toTrue
) tomake_number()
, as well as logic changes, to allow for generic parsing of prefixes 'M' as "less than" and 'P' as "greater than" without breaking existing 'M' as "-" logic.speak_prefix
parameter (str, defaults to "") tomake_fraction()
to allowmake_number()
to determine "greater than" or "less than" prefix on a fractional value.get_wind()
andget_visibility()
to setm_minus=False
in calls tomake_number()
.test_make_number()
parameters that requirem_minus=False
into a separate test.m_minus=False
in a few other unit tests that callmake_number()
for visibility/cloud strings.Very open to feedback on this implementation, but existing unit tests are all passing with only very minor updates.
Checklist
CHANGELOG.md
OR changes are insignificant