Skip to content

Commit 25b4844

Browse files
Expand byte size of samples_per_record (#92)
Co-authored-by: Alex Arslan <[email protected]>
1 parent 151f92f commit 25b4844

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "EDF"
22
uuid = "ccffbfc1-f56e-50fb-a33b-53d1781b2825"
33
authors = ["Beacon Biosignals, Inc."]
4-
version = "0.7.5"
4+
version = "0.8.0"
55

66
[deps]
77
BitIntegers = "c3b6d118-76ef-56ca-8cc7-ebb389d030a1"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ Compared to all features implied by the EDF/EDF+ specifications, this package is
1616
- Support for [the EDF+ `longinteger`/`float` extension](https://www.edfplus.info/specs/edffloat.html)
1717

1818
Where practical, this package chooses field names that are as close to EDF/EDF+ specification terminology as possible.
19+
20+
## Breaking Changes
21+
22+
In v0.8.0, the field `samples_per_record` of `SignalHeader` was changed from `Int16` to `Int32`.

src/read.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function read_signal_headers(io::IO, signal_count)
115115
strip(fields[i, 3]), parse_float(fields[i, 4]),
116116
parse_float(fields[i, 5]), parse_float(fields[i, 6]),
117117
parse_float(fields[i, 7]), strip(fields[i, 8]),
118-
parse(Int16, fields[i, 9])) for i in 1:size(fields, 1)]
118+
parse(Int32, fields[i, 9])) for i in 1:size(fields, 1)]
119119
skip(io, 32 * signal_count) # reserved
120120
return signal_headers
121121
end

src/types.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Type representing the header for a single EDF signal.
3333
* `digital_minimum::Float32`: minimum value of the signal that could occur in a data record
3434
* `digital_maximum::Float32`: maximum value of the signal that could occur in a data record
3535
* `prefilter::String`: non-standardized prefiltering information
36-
* `samples_per_record::Int16`: number of samples in a data record (NOT overall)
36+
* `samples_per_record::Int32`: number of samples in a data record (NOT overall)
3737
"""
3838
struct SignalHeader
3939
label::String
@@ -44,7 +44,7 @@ struct SignalHeader
4444
digital_minimum::Float32
4545
digital_maximum::Float32
4646
prefilter::String
47-
samples_per_record::Int16
47+
samples_per_record::Int32
4848
end
4949

5050
"""
@@ -133,11 +133,11 @@ Type representing a single EDF Annotations signal.
133133
134134
# Fields
135135
136-
* `samples_per_record::Int16`
136+
* `samples_per_record::Int32`
137137
* `records::Vector{Vector{TimestampedAnnotationList}}`
138138
"""
139139
struct AnnotationsSignal
140-
samples_per_record::Int16
140+
samples_per_record::Int32
141141
records::Vector{Vector{TimestampedAnnotationList}}
142142
end
143143

@@ -163,7 +163,7 @@ function AnnotationsSignal(records::Vector{Vector{TimestampedAnnotationList}})
163163
# treated similarly, i.e. the `SignalHeader` is overly trusted).
164164
max_bytes_per_record = maximum(sum(write_tal(IOBuffer(), tal) for tal in record)
165165
for record in records)
166-
return AnnotationsSignal(Int16(cld(max_bytes_per_record, 2)), records)
166+
return AnnotationsSignal(Int32(cld(max_bytes_per_record, 2)), records)
167167
end
168168

169169
function SignalHeader(signal::AnnotationsSignal)

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ end
257257

258258
@testset "BDF+ Files" begin
259259
# This is a `BDF+` file containing only trigger information.
260-
# It is similiar to a `EDF Annotations` file except that
260+
# It is similiar to a `EDF Annotations` file except that
261261
# The `ANNOTATIONS_SIGNAL_LABEL` is `BDF Annotations`.
262-
# The test data has 1081 trigger events, and
263-
# has 180 trials in total, and
262+
# The test data has 1081 trigger events, and
263+
# has 180 trials in total, and
264264
# The annotation `255` signifies the offset of a trial.
265265
# More information, contact: [email protected]
266266
evt = EDF.read(joinpath(DATADIR, "evt.bdf"))

0 commit comments

Comments
 (0)