Reimplement cumulative product NumPy functions #940
Merged
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.
This PR resolves two issues from #905 that were identified in #939:
First,
convert_arg
innumpy_func.py
presumespre_calc_units
is aUnit
orNone
, but there are instances where it was passed a string by way ofinputs_units
inimplement_func
. Now, anyinputs_units
as a string are converted to aUnit
before being passed toconvert_to_consistent_units
.Second, the cumulative product functions were using
implement_func
withinput_units
set to something other thanNone
, which was incorrect, since these functions have arguments that should not have units (namelyaxis
). These functions have been reimplemented accordingly.black -t py36 . && isort -rc . && flake8
with no errorsDocumented in docs/ as appropriateAdded an entry to the CHANGES file(fixup to previous change: NEP-18 Compatibility #905)