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

Update unit scaling #148

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

John2202W
Copy link
Collaborator

  • Add support for negative values in unit_convert and unit_scale
  • Made unit_scale allow case-insensitive unit matching and whitespace
  • Fixed possible fall-throughs in unit_convert(): ranges are now hard-coded to eng notation
  • Increase test coverage for unit_convert() and unit_scale()
  • Add to UNITS scaling options

Fixed possible fall-throughs in unit_convert(), but hardcoded range.

Fixed regex in unit_scale to detect negative numbers, allow for extra spaces and allow case-insensitive unit matching.
Added to unit and unit scaling sets.
Add support for negative values in unit_convert().
remove unused imports
Increase test coverage for unit_scale and unit_convert
Add more test coverage for unit_scale()
black formatting
Add comments and log errors in unit_convert()
@John2202W
Copy link
Collaborator Author

I've plugged some holes in the unit_convert and by doing so hardcoded the display range to agree with eng.notation. A bunch of different ways this function could be done - depends what we want?

The main intention was to clean up the ui display/input process. e.g. allow the user to enter a value of "6.6uF" when measuring a capacitor value. And from the display side automate the user_info: e.g. "the value should be in the range of 6.5u to 6.7u"

Also - the regex for the unit_scale may be getting nasty and could do with some attempts at breaking it

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