-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collaborate with Fortran Standard Library to support npy format I/O #5
Comments
I second what Milan wrote. @MRedies your implementation is short and simple, I think it would be a perfect fit. @milancurcic I think you might have tagged a wrong person. |
Indeed, an @ snuck in :). |
Hello, I am glad you like it and I'd be very happy if it can be part of stdlib. What do you need and how do you want me to help? Maybe the library could cover all datatypes and dimensions more systematically, because currently I added them kind of on personal needs. |
I am not sure how stdlib is built, but it think it would ne nice if the library can still be build without any other files. (Kind of like Boost where you can also build some modules seperately) |
Thank you @MRedies. We can definitely keep it separate, as well as include it in stdlib. Given how simple it is, I think there is a way to probably have exactly the same source code, so that there is no duplication of effort. The next step is to discuss the API. The process is described here: https://github.com/fortran-lang/stdlib/blob/master/WORKFLOW.md We can probably do it at the issue fortran-lang/stdlib#486, or open a new one. |
Is this going anywhere? @certik @MRedies @milancurcic |
I think I was waiting for @MRedies or @milancurcic to drive the effort :), but we got all busy. |
Thanks @certik for replying back so soon. I somehow have the feeling that the code could be compressed by using the KIND PARAMETER to prevent the duplication of code. |
libnpy seems to be a library that provides simple routines for saving a C or Fortran array to a data file using NumPy's own binary format.
|
program fex
use fnpy
use iso_c_binding
implicit none
integer :: i
real(C_DOUBLE) :: a(2,4) = reshape([(i, i=1,8)], [2,4])
call save_double("fa.npy", shape(a), a)
end program fe The program creates a file But the entries of the NumPy array now follow the Fortran (column-major) ordering. >>> fa = np.load('fa.npy')
>>> print fa
[[ 1. 3. 5. 7.]
[ 2. 4. 6. 8.]] You can build the executable
|
Hi Matthias, thank you for making this useful package.
I'm one of the maintainers of Fortran stdlib. We discussed supporting some common array storage file formats in fortran-lang/stdlib#486.
Are you interested in collaborating there on adding support for npy+npz file formats to stdlib?
The text was updated successfully, but these errors were encountered: