8000 Support for awkward arrays · Issue #63 · gradhep/relaxed · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Support for awkward arrays #63
Open
@ligerlac

Description

@ligerlac

It would be nice to able to apply relaxed cuts to awkward arrays. Consider the following code snippet:

x_np = np.arange(0, 10, 0.1)
y_relaxed = relaxed.cut(x_np, 5, slope=1)  # this works
y_manual = 0.5*np.tanh((x_np-5)/2)+0.5  # same result as line above

x_ak = ak.from_numpy(x_np)
y_relaxed = relaxed.cut(x_ak, 5, slope=1)  # this fails
y_manual = 0.5*np.tanh((x_ak-5)/2)+0.5  # this still works

It fails with
TypeError: exp requires ndarray or scalar arguments, got <class 'awkward.highlevel.Array'> at position 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0