-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Labels
Numpy 2.0 API Changestriage reviewIssue/PR to be discussed at the next triage meetingIssue/PR to be discussed at the next triage meeting
Description
Can we brainstorm a namespace for array creation/inspection utils? Maybe as part of np.lib.<submodule>, maybe directly np.<submodule>?
Functions I might dump there are:
byte_bounds(apparently some use it, and it's an OK function, but not really a general audience one, unlikemay_share_memorywhich I think makes sense at least for teaching).np.core._multiarray_umath._discover_array_parameters: Finds the shape and dtype the same way asnp.asarray(), but doesn't create the full array (although it does create some temporaries). Seems to be useful occasionally, and may also be useful to add additional functionality that we do not want innp.asarray().prepare_arrays(*arrays, *, kwarg=None)may be useful. For NEP 50, maybeasarray_or_pyscalarmakes just as much sense (one can trivially write that admittedly). @mdhaber liked the idea of having a function that converts multiple arrays to their result type (which could be an option there). I like the idea of clumping asarray calls; opitonally includingresult_typeseems convenient (even if it may not always be ideal as it assumes simple promotion is correct, it is effectively what is often used anyway).normalize_axis_index- Probably we can think of more functions to add there or move?
Maybe utils is already a decent name and it just needs to lose some of the weirder functions?
Metadata
Metadata
Assignees
Labels
Numpy 2.0 API Changestriage reviewIssue/PR to be discussed at the next triage meetingIssue/PR to be discussed at the next triage meeting