edfcore 0.5.30 → 0.5.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,5 +109,5 @@ export declare const SIGNAL_FIELD_BLOCK_OFFSETS: {
109
109
  readonly reserved: 224;
110
110
  };
111
111
  /** Published package version. Kept in sync with package.json by a test. */
112
- export declare const VERSION = "0.5.30";
112
+ export declare const VERSION = "0.5.32";
113
113
  //# sourceMappingURL=constants.d.ts.map
package/dist/constants.js CHANGED
@@ -79,5 +79,5 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
79
79
  reserved: 224,
80
80
  };
81
81
  /** Published package version. Kept in sync with package.json by a test. */
82
- export const VERSION = '0.5.30';
82
+ export const VERSION = '0.5.32';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,54 @@ alone does not tell you whether you were affected.
6
6
  edfcore is pre-1.0. Patch releases have carried behaviour changes where the old behaviour was a
7
7
  defect; those are called out below.
8
8
 
9
+ ## 0.5.32
10
+
11
+ - **Added** a lattice check over the ten microvolt values `quick-start.md` prints. That page prints
12
+ two `Float64Array` blocks — five values from a window at `t = 0` in the browser example, five more
13
+ from `t = 60` in the Node one. They are the first numbers anyone sees from this library, and
14
+ `quick-start-page.test.ts` runs everything around them: the header listing, the sample count, the
15
+ byte count, the annotation lines, the three refusals. The values themselves it did not touch.
16
+ - They cannot be reproduced from the page, which names its file's geometry and not its waveform.
17
+ What they can be checked against is the scale that geometry implies, and that turns out to be the
18
+ check worth having: a physical value is `bitValue * (offset + digital)` for an integer `digital`,
19
+ so on a given declaration the reachable values are a lattice, and a float that is not on it was
20
+ produced by a different expression or a different range.
21
+ - That is not hypothetical. 0.5.6 found exactly that on `api-types.md` — two printed values belonged
22
+ to a file with a different digital range from the one the rest of the page's example used, and the
23
+ existing test checked five of seven lines and stopped before them. A lattice check catches it
24
+ without needing the waveform, and would have caught it there. The last test makes the point
25
+ concretely by converting the same digital sample on a 12-bit declaration and showing it lands
26
+ somewhere else.
27
+ - Each of the ten is inverted through the declared scale, asserted to be a whole number inside the
28
+ declared range, and put back through `toPhysical` on a real signal, compared with `Object.is` —
29
+ `toBeCloseTo` would pass on a value from the wrong scale. The page's own argument for the array
30
+ type goes with them: every one of the ten changes under `Math.fround`, so "a sample scaled into
31
+ float32 loses about a quarter of a quantisation step" is true of the very values printed beneath
32
+ it. And the first value is asserted to be what digital zero converts to, which is not zero.
33
+
34
+ ## 0.5.31
35
+
36
+ - **Added** the record-range contract at the five calls that take one. `RecordRange` is the other
37
+ half of the selection contract 0.5.29 covered, and it reaches three layers — `readRecordBytes` in
38
+ the I/O layer, `readRecords` and `readAnnotations` in the recording layer, `decodeDigital` and
39
+ `decodeAnnotations` in the decoders. Unlike the signal selections, they do not share a validator:
40
+ each asserts the range for itself.
41
+ - That is the reason to check them together. `api-reading.md` documents one behaviour — an
42
+ `EdfRangeError` when the range is not inside `header.recordCount` — and a caller who tested against
43
+ `readRecords` has no way to know whether `decodeDigital` agrees. The error also carries `requested`
44
+ and `available` so a caller can clamp and retry, and those have to hold the same two ranges at
45
+ every site or the retry computes the wrong one; that is now asserted as one set rather than five
46
+ times over.
47
+ - Six bad ranges run at all five: a start past the end, a count that runs past it, a negative start,
48
+ a negative count, a fractional start and a fractional count. The last two are the ones a caller
49
+ reaches without noticing — a `Math.floor` left off a division, a range built from `seconds * rate`
50
+ — and they are refused rather than truncated, because a range that silently became
51
+ `{ start: 0, count: 1 }` would return real samples for a question nobody asked.
52
+ - `count: 0` is accepted at all five, including at the end of the file where a count of one is not,
53
+ which is the case the page singles out. The two decoders check something else as well — the buffer
54
+ they were handed against the range they were given — and that second check is exercised rather
55
+ than worked around, since it is the one that catches a caller pairing a range with the wrong bytes.
56
+
9
57
  ## 0.5.30
10
58
 
11
59
  - **Added** what `diagnostics.md` prints for one header, printed. The page introduces the two ways of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.5.30",
3
+ "version": "0.5.32",
4
4
  "description": "Modern, typed, zero-dependency reader for EDF, EDF+, BDF and BDF+ biosignal files. Works in browsers and Node with true random access.",
5
5
  "keywords": [
6
6
  "edf",
package/src/constants.ts CHANGED
@@ -93,4 +93,4 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
93
93
  } as const;
94
94
 
95
95
  /** Published package version. Kept in sync with package.json by a test. */
96
- export const VERSION = '0.5.30';
96
+ export const VERSION = '0.5.32';