Draft
Conversation
Collaborator
John2202W
commented
Jul 11, 2022
- 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()
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.