-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
I really spelled |
One step that could potentially be done to make a more complete test coverage is to parameterize tests for all unit conversions. Currently, only the angle to radians and radians to angle tests are parameterized in this way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! There was one more thing that I wanted to check, and that was to see if the unit converter works with array-like objects as well as scalars.
Looking at the code, it probably should. Could you do the following:
- Add some tests to see if passing in ND arrays works where the conversion happens elementwise
- Change the typing from
Scalar
toArrayLike
for both theUnitConverter
and theConversionFactor
class as appropriate? Take a look at the ArrayLike type. It covers both scalars and arrays in a single type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. Just one small comment but I'm approving now. Once you make the change, feel free to merge this PR.
Description
UnitConverter
class,__init__
andconvert
functionsScalarOrArray
typeVerification
tests/unit/common/test_unit_conversions.py
Resources