Skip to content

Commit

Permalink
add warning about samples being encoded (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericphanson authored Oct 12, 2023
1 parent 81e778c commit 2e27a1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OndaEDF"
uuid = "e3ed2cd1-99bf-415e-bb8f-38f4b42a544e"
authors = ["Beacon Biosignals, Inc."]
version = "0.12.1"
version = "0.12.2"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
12 changes: 12 additions & 0 deletions src/import_edf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,13 @@ end
##### `EDF.Signal`s -> `Onda.Samples`
#####

const SAMPLES_ENCODED_WARNING = """
!!! warning
Returned samples are integer-encoded. If these samples are being serialized out (e.g. via `Onda.store!`)
this is not an issue, but if the samples are being immediately analyzed in memory, call `Onda.decode`
to decode them to recover the time-series voltages.
"""

struct SamplesInfoError <: Exception
msg::String
cause::Exception
Expand Down Expand Up @@ -514,6 +521,8 @@ If `validate=true` (the default), the plan is validated against the
If `dither_storage=missing` (the default), dither storage is allocated automatically
as specified in the docstring for `Onda.encode`. `dither_storage=nothing` disables dithering.
$SAMPLES_ENCODED_WARNING
"""
function edf_to_onda_samples(edf::EDF.File, plan_table; validate=true, dither_storage=missing)

Expand Down Expand Up @@ -629,6 +638,7 @@ See `Onda.encode`'s docstring for more details.
This function is not meant to be called directly, but through
[`edf_to_onda_samples`](@ref)
$SAMPLES_ENCODED_WARNING
"""
function onda_samples_from_edf_signals(target::SamplesInfoV2, edf_signals,
edf_seconds_per_record; dither_storage=missing)
Expand Down Expand Up @@ -801,6 +811,8 @@ following transformations:
(e.g. "m1" in an EEG-matched channel name will be converted to "a1").
See the OndaEDF README for additional details regarding EDF formatting expectations.
$SAMPLES_ENCODED_WARNING
"""
function edf_to_onda_samples(edf::EDF.File; kwargs...)
signals_plan = plan_edf_to_onda_samples(edf; kwargs...)
Expand Down

2 comments on commit 2e27a1f

@ericphanson
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/93320

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.2 -m "<description of version>" 2e27a1f80a0269fb022eec6a3a48b9132241eba9
git push origin v0.12.2

Please sign in to comment.