Conversation
especially with countable amounts, like currency, cups etc. they are not interchangable and units can be used to distinguish them.
davidhassell
left a comment
There was a problem hiding this comment.
Hi @rju,
Thank you! I've make some suggestions/asked some questions, but it looks good and works as far as I can tell by playing on the command line (the proper units test will tell all :)).
Would you like add yourself as a contributor at docs/source/contributing.rst?
| return out.decode("utf-8") | ||
|
|
||
| @classmethod | ||
| def new_unit(cls, name): |
There was a problem hiding this comment.
I've added documentation in my branch.
There was a problem hiding this comment.
In case this is sufficient, please resolve the conversation.
cf_test.py
Outdated
| @@ -0,0 +1,59 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
Would it be possible to recast this a new method in cfunits.cfunits.test.UnitsTest?
The tests need be framed with self.ssertTrue, self.assertFalse, self.assertEqual, etc.
There was a problem hiding this comment.
I've added a test in UnitsTest checking only the custom unit feature. And removed cf_test.py
There was a problem hiding this comment.
In case this is sufficient, please resolve the conversation.
Co-authored-by: David Hassell <davidhassell@users.noreply.github.com>
Co-authored-by: David Hassell <davidhassell@users.noreply.github.com>
Added comment / documentation to new_unit
|
I hope the test is sufficient. |
This pull request adds the feature to add custom units programmatically. See also #58