long_field_names
option when writing neo blocks in .mat files
#1636
Labels
long_field_names
option when writing neo blocks in .mat files
#1636
Describe the bug
We're trying to load an Intan .rhs file using
neo.io.IntanIO
module and then writing it into a.mat
file usingneo.io.NeoMatlabIO
.When doing this, the editor raises
"ValueError: Field names are restricted to 31 characters"
relating to thescipy.io.savemat
function. This is because thewrite
method withinNeoMatlabIO
object doesn't pass any additional argument than the block to thewrite_block
method, even if the function accepts**kargs
which remains unused within it.The issue could be easily solved by adding the argument
long_field_names=True
as input toscipy.io.savemat
function, which expands to 64 the maximum number of characters for a field.To Reproduce
The code that we are using is:
the
analogsig
object within the block contains an annotation calleddesired_impedance_test_frequency
which has 32 characters, causing the issue.Expected behaviour
We propose a minimal modification to the
write_block
method within theNeoMatlabIO
class:**kargs
as input toscipy.io.savemat
: this won't cause any issue because it remains unused within the code and will allow to pass any argument accepted by thesavemat
function directly in thewrite
method at the begininng, that in our case islong_field_names=True
.We have tested and with this modification all works as expected.
A brief description of the proposed changes to enhance clarity:
this reflected in our code in:
Environment:
The text was updated successfully, but these errors were encountered: