Description
#3091 introduced returning a numpy structured array from a compatible metadata buffer. The StructCodec
allows the specification of string encoding in the schema, however numpy only supports bytes
and utf-32
in S
and U
dtypes. #3091 therefore returns structured arrays with only the S
dtype for each string field.
At the cost of a copy and some shuffling, it would be possible to decode these to the users specification in the schema using numpy.char.decode
then reassigning the encoded string array back into the structured array. This could be implemented as an option with a boolean flag decode_strings
to structured_array_from_buffer
, however as ts.X_metadata
is a property this couldn't be set when retrieving the array, so either an additional property on the ts (ts.X_metadata_string_decode
?) or leaving the user to do this via the lower-level code.