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
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.
The text was updated successfully, but these errors were encountered:
ericphanson
changed the title
failed to fit number into EDF's 8 ASCII character limit: 1.0e-9
EDF.jl does not allow truncating header values to 0, even when it should
Oct 17, 2023
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
.The text was updated successfully, but these errors were encountered: