ENH: Adds cross2d to core and linalg (with API compatibility) #26640

At the community meeting on Wednesday, we discussed adding `cross2d` as a new function, partly because of the deprecation of 2d arrays in `cross` (two issues are linked in the PR). Whether or not this is the right approach to take is something we want to have a bigger discussion about. One option discussed was adding both `cross2d` and `linalg.cross2d`. Another was just adding Array API compatible `linalg.cross2d`. Another was referring users to using `linalg.det` (though the return value is always floats which could be an issue). I volunteered to write the functions (partly as an exercise to learn the ins and outs of NumPy) and submitted the new functions as a PR. See https://github.com/numpy/numpy/pull/26640. I'm not offended at all if we decide on another route. We did discuss at the meeting that we need to provide some kind of alternative for people who use `cross` currently. One of the examples I updated for `cross` in the PR shows an option to pad 2D vectors and then use `cross`, though this will most likely be computationally much slower than `cross2d`.
participants (1)
-
Ben Woodruff