Skip to content

array function implementation for np.cumprod / np.nancumprod fails with axis #939

@keewis

Description

@keewis

Passing a axis argument to cumprod / nancumprod will make them fail. I tracked it down to

if pre_calc_units.dimensionless:
where pre_calc_units can be a string ("dimensionless"), but a Unit object was expected. The string was created when implement_func was called for cumprod and nancumprod (by the way, cumprod also gets implemented with set_units_ufuncs). We can fix this by passing None as input_units instead, but if feasible I'd prefer "dimensionless" since that is way easier to read and understand. For that, we might need to preprocess the input_units parameter in implement_func.

Metadata

Metadata

Assignees

No one assigned

    Labels

    numpyNumpy related bug/enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions