You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it should be possible for npyio.Write and npyio.Read to properly handle user-defined types, e.g.type MyMatrix struct {...}
probably by having said user-defined type implement an interface that allows to describe the internal data:
a way to expose equivalent data to npyio.Header.Descr
a way to expose the underlying data slice []T (where T is one of the scalar types that npyio supports)
Alternatively, have npyio expose npyio.Marshaler and npyio.Unmarshaler interfaces (which would then be tested for and used in npyio.Write and npyio.Read, respectively)
Tentatively:
typeTypestruct {
Namestring// e.g. '<f8'Shape []intFortranbool
}
typeMarshalerinterface {
MarshalNPy() (dtypeType, data []byte, errerror)
}
typeUnmarshalerinterface {
UnmarshalNPy(dtypeType, data []byte) error
}
The text was updated successfully, but these errors were encountered:
it should be possible for
npyio.Write
andnpyio.Read
to properly handle user-defined types, e.g.type MyMatrix struct {...}
probably by having said user-defined type implement an interface that allows to describe the internal data:
npyio.Header.Descr
[]T
(whereT
is one of the scalar types thatnpyio
supports)Alternatively, have
npyio
exposenpyio.Marshaler
andnpyio.Unmarshaler
interfaces (which would then be tested for and used innpyio.Write
andnpyio.Read
, respectively)Tentatively:
The text was updated successfully, but these errors were encountered: