Skip to content

Decide how/if to have hooks for .imag/.real or general dtype specific attributes #13

@seberg

Description

@seberg

The .imag and .real properties of ndarray return views into the original array. This means they cannot be described, e.g. by UFuncs. We could add an imag/real method/slot to the new DTypes which:

  • Returns the offset into the existing dtype
  • Returns a new dtype
    With that information, the ndarray can return the new view.

We could allow dtypes to tag on more special attributes (think quaternions, etc.). But it seems dangerous, at least for now. However, another thing would be to do this through some special new attribute on ndarray, such as ndarray.elementwise.<method>(*args, **kwargs) calling special dtype.arr_methods.<method>(array, dtype, *args, *kwargs) or similar.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions