Skip to content

Trapz dx doesn't trigger array_function mechanism #5

@mocquin

Description

@mocquin

This is numpy-related issue : given the current interface, we can't do anything about this problem.
An issue is opened at numpy with a dummy example : numpy#18902

In the case of physipy :

from physipy import m
import numpy as np

arr = np.arange(10)
q = arr * m

# all these work
print(np.trapz(arr, arr, dx=0.5))
print(np.trapz(arr, q, dx=0.5))
print(np.trapz(arr, arr, dx=0.5*m))
print(np.trapz(arr, dx=0.5))
print(np.trapz(q, dx=0.5*m))

# but not this one 
print(np.trapz(arr, dx=0.5*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