Skip to content

DType Discovery #20

@seberg

Description

@seberg

The current dtype discovery approach is based on first discovering the DType (class) and then discovering the dtype instance in a second pass (if necessary).

This is slightly annoying, the main motivation for it are String DTypes. Removing the first pass, may mean that common_dtype slot is not needed anymore, but instead should be a common_descriptor slot. However:

  1. common_dtype may be useful for UFunc dispatching/type resolution (it is currently effectively used). If UFunc dispatching ends up needing common_dtype having both may be inflation of API functions?
  2. Strings cannot be handled, they require two passes currently. The solution is to keep the current (ugly) logic as legacy. New String dtypes would/can be expected to use dtype=String if they require special logic. If they require special logic, they should likely refuse to common_descr for that. E.g. common_descriptor(datetime[ns], str) should not work if array(["2019"], dtype=datetime64) guesses the year unit.

The main advantage is slightly reducing complexity.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions