From b683f196ccf3081b4da5be02a701c7cb5ca7eb50 Mon Sep 17 00:00:00 2001 From: Dave Kleinschmidt Date: Wed, 19 Jul 2023 15:53:21 -0400 Subject: [PATCH] the fix --- Project.toml | 2 +- src/export_edf.jl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index fd2754b..7011f96 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "OndaEDF" uuid = "e3ed2cd1-99bf-415e-bb8f-38f4b42a544e" authors = ["Beacon Biosignals, Inc."] -version = "0.12.0" +version = "0.12.1" [deps] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" diff --git a/src/export_edf.jl b/src/export_edf.jl index 3926f1c..c063d1f 100644 --- a/src/export_edf.jl +++ b/src/export_edf.jl @@ -134,6 +134,8 @@ function reencode_samples(samples::Samples, sample_type::Type{<:Integer}=Int16) samples.info.sample_resolution_in_unit, samples.info.sample_offset_in_unit, (smin, smax)) + # make sure we handle negative resolutions properly! + # smin, smax = extrema((smin, smax)) end if smin >= typemin(sample_type) && smax <= typemax(sample_type) # XXX: we're being a bit clever here in order to not allocate a