julia> EDF.write( IOBuffer(), edf)
ERROR: failed to fit number into EDF's 8 ASCII character limit: 1.0e-9
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] _edf_repr(x::Float32)
@ EDF ~/EDF.jl/src/write.jl:37
[3] edf_write(io::IOBuffer, value::Float32, byte_limit::Int64)
@ EDF ~/EDF.jl/src/write.jl:49
[4] write_header(io::IOBuffer, file::EDF.File{Int16, IOBuffer})
@ EDF ~/EDF.jl/src/write.jl:95
[5] write(io::IOBuffer, file::EDF.File{Int16, IOBuffer})
@ EDF ~/EDF.jl/src/write.jl:180
[6] top-level scope
@ REPL[118]:1
The issue: EDF.jl does not want to round the physical_minimum down to zero, although that would be perfectly fine.
I think it is odd that the current _edf_repr code allows truncation to any value except 0, and if we have semantic concerns about truncating to 0, that should be checked in the EDF.File (or Signal) constructors on the appropriate fields, rather than applying to all numeric fields in _edf_repr.
Here I use OndaEDF to more easily construct the
EDF.File
object, but I believe the bug is inEDF.write
.Setup:
The resulting EDF looks like:
When we try to
write
it:The issue: EDF.jl does not want to round the
physical_minimum
down to zero, although that would be perfectly fine.I think it is odd that the current
_edf_repr
code allows truncation to any value except 0, and if we have semantic concerns about truncating to 0, that should be checked in theEDF.File
(orSignal
) constructors on the appropriate fields, rather than applying to all numeric fields in_edf_repr
.