Few things in the Python API care about order, but there are also quite
a few places that will return C-order (and are faster for C-order
inputs) whether you change those defaults or not.

The main issue is that e.g. some cython wrappers will probably assume
that the newly created array is C-order.  And those will just not work.

For example, I would imagine many libraries that have C/Cython wrappers
have code that doesn't specify `order="C"` explicitly (why would they?)
but then passes it into a typed memory-views (if cython) like
`double[:, ::1]` enforcing a C-contiguous memory layout for speed.
Such code should normally fail gracefully, but fail it will.

Also, as Aaron said, a lot of these places might not enforce it but
still be speed impacted.

So yes, it would be expected break a lot of C-interfacing code that has
Python wrappers around it to normalize input.

- Sebastian



On Fri, 2023-11-10 at 22:37 +0000, Valerio De Benedetto wrote:
> Hi, I found that the documented default row-major order is enforced
> throughout the library with a series of `order='C'` default
> parameters, so given this I supposed there's no way to change the
> default (or am I wrong?)
> If, supposedly, I'd change that by patching the library (substituting
> 'C's for 'F's), do you think there would by any problem with other
> downstream libraries using numpy in my project? Do you think they
> assume a default-constructed array is always row-major and access the
> underlying data?
> _______________________________________________
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: sebast...@sipsolutions.net
> 


_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to