Skip to content

Continue refactoring and maintenance of new array coercion. #8

Closed

Description

@seberg

@mattip if you have time, maybe you can look at the refactor of array coersion (param detection + filling new array). All of this likely needs some refactor.

PyArray_DiscoverDTypeAndShapeFromObject(

Is the central function which finds the shape and dtype right now. It calls the main function for finding the right DType (only the class, not the actual dtype, e.g. string length!):

PyArray_DiscoverDTypeFromObjectRecursive(

If the input is string (or another "flexible" dtype) a second pass will be done to figure out the string length. There is some annoying thing around promotion, since np.array(big_endian_float64_arr) actually preserves the endianess.

Currently it used mainly through PyArray_GetArrayParamsFromObject (except for the ufunc code). The actually filling then is done by setArrayFromSequence, however, if we leave that cache design to store converted __array__ objects, then we need to replace it with a simpler version using the coercion cache.

There are probably many confusing details here, so lets talk if you look at it and get stuck.

Activity

  1. self-assigned this
    on Nov 20, 2019
  2. mattip commented on Nov 20, 2019

    @mattip
    Collaborator

    This is on the dtypemeta branch

  3. added a commit that references this issue on Dec 7, 2021
  4. added a commit that references this issue on Apr 12, 2023
  5. mattip commented on Jul 27, 2023

    @mattip
    Collaborator

    Going through my old issues, I think we can close this right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions