Skip to content

Followups for same-value casting #29765

@seberg

Description

@seberg

Creating an issue for follow up on gh-29129. Also ping @mhvk because I am sure I'll forget things right now.

Some of these are very concrete, others a bit less so:

  • There is now the _FLAG which part which is necessary for user dtypes. We should document at least that flag.
  • I am not quite sure, but related, we may need to document the new flag on the context (likely is already)
  • The design is in a way so that we could thread this cast to all places easily. Explicitly np.can_cast also.
    • @mattip wants to not really do this unless there is a clear user.
    • We might need this, but I am not quite sure. The problem is projects like cupy or so that might rely on e.g. can_cast.
    • Other places, where I think it just clearly makes sense is e.g. concatenate with dtype=.
  • There is a clear gap that equiv casts are always same_value casts. But for existing dtypes this isn't the case. It would be good to explore if we can automatically set the flag for the dtype.
    • Maybe during registration or in MinCastSafety, or... ?

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