Skip to content

Array function interface not triggered on scalars #9

@mocquin

Description

@mocquin

Calling a numpy function with only scalars will not trigger the array function interface, since it is used only when an argument is an array.

from physipy import m
# this raises a DimensionError because of the casting into float
#np.random.normal(3*m, 1*m)
# while this works but return a float
np.random.normal(np.array(3*m), np.array(1*m))

# this also drops the unit
np.sum(np.array(3*m))

Metadata

Metadata

Assignees

No one assigned

    Labels

    numpynumpy related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions