From 2f7bec90004c0eca33e4ed1375bf5520120dd1f9 Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Wed, 29 Jan 2025 09:23:17 -0600 Subject: [PATCH] update docs and Documenter version --- docs/Project.toml | 2 +- docs/src/api.md | 16 +++++++++++++++- docs/src/convert-to-onda.md | 10 +++++----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index 101c2b6..1814eb3 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -2,4 +2,4 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" [compat] -Documenter = "0.26" +Documenter = "1" diff --git a/docs/src/api.md b/docs/src/api.md index 08bfe21..61f0268 100644 --- a/docs/src/api.md +++ b/docs/src/api.md @@ -9,7 +9,7 @@ CurrentModule = OndaEDF OndaEDF.jl prefers "self-service" import over "automagic", and provides functionality to extract [`Onda.Samples`](https://beacon-biosignals.github.io/Onda.jl/stable/#Samples-1) -and [`EDFAnnotationV1`](@ref)s (which extend +and [`EDFAnnotationV1`](@ref)s (which extend [`Onda.AnnotationV1`](https://beacon-biosignals.github.io/Onda.jl/stable/#Onda.AnnotationV1)s) from an `EDF.File`. These can be written to disk (with [`Onda.store`](https://beacon-biosignals.github.io/Onda.jl/stable/#Onda.store) / @@ -33,9 +33,17 @@ EDFAnnotationV1 ### Import plan table schemas +!!! note "Plan version is dependent on EDF.jl version" + The utilized plan version is dependent on the EDF.jl version. + For EDF 0.8+, V3 are used, while V2 is used for for EDF 0.7. + The change from V2 to V3 reflects the change from [`Int16` to `Int32` + in EDF.jl's `samples_per_record`](https://github.com/beacon-biosignals/EDF.jl/releases/tag/v0.8.0). + ```@docs PlanV2 +PlanV3 FilePlanV2 +FilePlanV3 write_plan ``` @@ -63,6 +71,12 @@ OndaEDF.promote_encodings onda_to_edf ``` +#### Internal export utilities + +```@docs +OndaEDF.reencode_samples +``` + ## Deprecations To support deserializing plan tables generated with old versions of OndaEDF + diff --git a/docs/src/convert-to-onda.md b/docs/src/convert-to-onda.md index 5d5812e..11527ff 100644 --- a/docs/src/convert-to-onda.md +++ b/docs/src/convert-to-onda.md @@ -101,7 +101,7 @@ To break this label specification down: - `["emg", "chin"]`: indicates that this specification is for `sensor_type` of `"emg"`, for which `"chin"` is accepted as a non-canonical alternative. - `["chin" => ["emg"]]` specifies that there's _one_ possible channel for this sensor type, whose canonical label (used in the output) is `"chin"`, but for which an alternative of `"emg"` is accepted. -This essentially tricks OndaEDF into treating `CHIN EMG` as sensor type of "`CHIN` (alternative for sensor type of `EMG`), and channel label "`EMG` (alternative way to specify `CHIN`)". For more details on how this matching is carried out, see [`plan_edf_to_onda_samples`](@ref) and [`match_labels`](@ref). +This essentially tricks OndaEDF into treating `CHIN EMG` as sensor type of "`CHIN` (alternative for sensor type of `EMG`), and channel label "`EMG` (alternative way to specify `CHIN`)". For more details on how this matching is carried out, see [`plan_edf_to_onda_samples`](@ref) and the internal [`OndaEDF.match_edf_label`](@ref). #### Preprocess signal headers @@ -117,8 +117,8 @@ edf = EDF.File(my_edf_file_path) function corrected_header(signal::EDF.Signal) header = signal.header - return Tables.rowmerge(header; - label=header.transducer_type, + return Tables.rowmerge(header; + label=header.transducer_type, transducer_type=header.label) end @@ -200,7 +200,7 @@ If any errors _were_ encountered, you may need to iterate further. The final step is to store both the `Onda.Samples` and the executed plan in some persistent storage. For storing `Onda.Samples`, see [`Onda.store`](https://beacon-biosignals.github.io/Onda.jl/stable/#Onda.store), which supports serializing LPCM-encoded samples to [any "path-like" type](https://beacon-biosignals.github.io/Onda.jl/stable/#Support-For-Generic-Path-Like-Types) (i.e., anything that provides a method for `write`). -For storing the plan, use [`OndaEDF.write_plan`](@ref) (or `Legolas.write(file_path, plan, FilePlanV2SchemaVersion())` (see the documentation for [`Legolas.write`](https://beacon-biosignals.github.io/Legolas.jl/stable/#Legolas.write) and [`FilePlanV2`](@ref). +For storing the plan, use [`OndaEDF.write_plan`](@ref) (or `Legolas.write(file_path, plan, FilePlanV3SchemaVersion())` (see the documentation for [`Legolas.write`](https://beacon-biosignals.github.io/Legolas.jl/stable/#Legolas.write) and [`FilePlanV3`](@ref OndaEDF.FilePlanV3). ## Batch conversion of many EDFs @@ -262,7 +262,7 @@ function plan_all(edf_paths, files; kwargs...) plan = DataFrame(plan) # make sure this is the same every time this function is re-run! recording = uuid5(NAMESPACE, string(origin_uri)) - return insertcols!(plan, + return insertcols!(plan, :origin_uri => origin_uri, :recording => recording) end