Skip to content

Commit

Permalink
update docs and Documenter version
Browse files Browse the repository at this point in the history
  • Loading branch information
palday committed Jan 31, 2025
1 parent 5b921e5 commit 2f7bec9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "0.26"
Documenter = "1"
16 changes: 15 additions & 1 deletion docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) /
Expand All @@ -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
```

Expand Down Expand Up @@ -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 +
Expand Down
10 changes: 5 additions & 5 deletions docs/src/convert-to-onda.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2f7bec9

Please sign in to comment.