diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-20 01:46:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-20 01:46:57 +0000 |
commit | a7ec41c14691634b57bd3389b3c7fc1ed114515a (patch) | |
tree | e2886f654835de9417f184004a8b966c7d20d9df /pint/compat.py | |
parent | cc2e00275e23b774aca36f77f7328f0f4c7169e3 (diff) | |
parent | 0d6a4360c222683327655ec9b1d698fa8e5b738a (diff) | |
download | pint-a7ec41c14691634b57bd3389b3c7fc1ed114515a.tar.gz |
Merge #940
940: Reimplement cumulative product NumPy functions r=hgrecco a=jthielen
This PR resolves two issues from #905 that were identified in #939:
First, `convert_arg` in `numpy_func.py` presumes `pre_calc_units` is a `Unit` or `None`, but there are instances where it was passed a string by way of `inputs_units` in `implement_func`. Now, any `inputs_units` as a string are converted to a `Unit` before being passed to `convert_to_consistent_units`.
Second, the cumulative product functions were using `implement_func` with `input_units` set to something other than `None`, which was incorrect, since these functions have arguments that should not have units (namely `axis`). These functions have been reimplemented accordingly.
- [x] Closes #939
- [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors
- [x] The change is fully covered by automated unit tests
- ~~Documented in docs/ as appropriate~~
- ~~Added an entry to the CHANGES file~~ (fixup to previous change: #905)
Co-authored-by: Jon Thielen <github@jont.cc>
Diffstat (limited to 'pint/compat.py')
0 files changed, 0 insertions, 0 deletions