-
Notifications
You must be signed in to change notification settings - Fork 25
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
Problems in parse_string #60
Comments
Hey @darkblaze69 thanks for your interest. Bug 1
This is not a bug.
Bug 2
I'm not so sure about this request. I'm fundamentally torn on the idea. At its heart bitmath is a library intended to finally do units right. The allowed inputs are strict and the output is always accurate and predictable. Extending On the other hand, it might be useful to introduce a new function (or find a way to extend
Maybe I can come up with something that meets your requirements...
|
@darkblaze69 I pushed a new branch for testing. It's called Docs are viewable here for now, search this file for "parse_string_unsafe": https://raw.githubusercontent.com/tbielawa/bitmath/shell_unit_parser/docsite/source/module.rst Here's a code block demonstrating the specific examples you listed in your original issue report: import bitmath
print bitmath.parse_string_unsafe('7.5KB')
7.5 kB
print bitmath.parse_string_unsafe("4.7MB")
4.7 MB
print bitmath.parse_string_unsafe("4.7M")
4.7 MB |
@tbielawa looks good to me now, wish this function to be in main package. Thanks |
Ill get to work on that next! Thanks for testing for me! You'll get an update in this thread once i submit all the updates On Jul 16, 2016 12:55 PM, "darkblaze69" [email protected] wrote:
|
@darkblaze69 New uploads have been pushed to
Docs have been updated quite thoroughly (you're thanked in the news update: http://bitmath.readthedocs.io/en/latest/NEWS.html#bitmath-1-3-1-1 ) Also, I added a toggle-switch so you can force the input to parse as base-2 if you want instead of base-10. TODO: Create the PPA builds for:
TODO: Create the Fedora/EPEL builds for:
|
great, thanks! killer feature |
Bug 1 :
bitmath.parse_string('7.5KB')
ValueError: The unit KB is not a valid bitmath unit
Bug 2:
Please add a fix to parse strings with only SI units. e.g. 10K, 10M etc.
example:
bitmath.parse_string("4.7MB")
MB(4.7)
bitmath.parse_string("4.7M")
ValueError: The unit M is not a valid bitmath unit
The text was updated successfully, but these errors were encountered: