NpyIO : v0.12.0 r/w user structs

82 views
Skip to first unread message

Sebastien Binet

unread,
Aug 9, 2025, 11:25:38 AM8/9/25
to golang-nuts
Hi there,

Yesterday, I've released v0.12.0 of npyio, a package that achieves interoperability with numpy data files:

https://pkg.go.dev/codeberg.org/sbinet/np...@v0.12.0#example-package-ReadIntoUserStruct

https://pkg.go.dev/codeberg.org/sbinet/np...@v0.12.0#example-package-WriteUserStruct

This release provides improved support for the so called recarrays (record arrays, or arrays of composite types).

One can now read recarrays into user provided struct values (and slices/arrays of those) as well as save these values into numpy data files (and read them back from python).

Not all Go values are supported nor meaningful in a numpy data file context (ie: maps, interfaces and channels are off limits).

Also, right now ragged arrays can only be read, not written (writing support would mean writing a pickle serialization package - gpython has one but it's a bit of a large dependency).

Enjoy,
-s
signature.asc

Jason E. Aten

unread,
Aug 9, 2025, 4:40:06 PM8/9/25
to golang-nuts
Very nice! Thanks Sebastien!
Reply all
Reply to author
Forward
0 new messages