[Numpy-discussion] Re: Fortran-style support in ctypeslib.as_array()?

2023-04-06 Thread monte . b . hoover
Hi Rob, Thanks for that. I'll take a look and let you know. -Monte ___ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org

[Numpy-discussion] Re: Fortran-style support in ctypeslib.as_array()?

2023-03-28 Thread Rob Farmer
Hi Monte, I did send an email around a few weeks also on this https://mail.python.org/archives/list/numpy-discussion@python.org/message/R6OARH7GJ3XPRFZC55XGYDW4S4GZXA5H/ and have a working example at https://github.com/rjfarmer/numpy/tree/ctypelibs_as_array_flags but haven't gotten around to

[Numpy-discussion] Re: Fortran-style support in ctypeslib.as_array()?

2023-03-28 Thread monte . b . hoover
Eric, Thanks for the reply. My use case is using ctypes as an interface between Numpy and Fortran in cases where I can't/don't want to use f2py. It's easy enough for me to put a wrapper around ctypeslib.as_array() so that I can read in multidimensional Fortran arrays correctly (I reverse the

[Numpy-discussion] Re: Fortran-style support in ctypeslib.as_array()?

2023-03-23 Thread Eric Wieser
Hi Monte, This strikes me as a slightly strange request; ctypes is intended to interface with the C memory model, which has no native representation of fortran arrays. The underlying workings of `as_array` is to cast your ctype pointer into a ctypes array object, and then pass that into numpy.