edfcore 0.4.521 → 0.4.523

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.
package/README.md CHANGED
@@ -77,7 +77,7 @@ for (const event of annotations) {
77
77
  }
78
78
  ```
79
79
 
80
- > **Status: 0.4.x, early.** edfcore runs 2,500+ tests on generated fixtures, and it's checked
80
+ > **Status: 0.4.x, early.** edfcore runs 2,700+ tests on generated fixtures, and it's checked
81
81
  > against public corpora it didn't author: the EDF, EDF+ and 24-bit BDF+ test files from
82
82
  > teuniz.net, and PhysioNet's sleep-edfx (a real 22-hour polysomnography recording and its
83
83
  > sleep-staging file). Those checks are numeric. Channels labelled `sine 8.5 Hz` decode to
@@ -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.4.521";
112
+ export declare const VERSION = "0.4.523";
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.4.521';
82
+ export const VERSION = '0.4.523';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,59 @@ 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.4.523
10
+
11
+ - **Fixed** a vacuous assertion in `inspect-safety.test.ts`, the property test for the strongest
12
+ promise in the package. It read `header.signals.length` against
13
+ `header.signals.filter((signal) => signal !== undefined).length` — a `readonly EdfSignal[]` has
14
+ no holes, so the filter drops nothing and the line compared a number with itself.
15
+ - It is the same line, in the same words, that `whole-api.test.ts` carried until 0.3.101, where its
16
+ own docblock records finding it. The copy here outlived the fix by four hundred releases, and it
17
+ was the one line in the file claiming to check that a report is internally coherent rather than
18
+ merely present.
19
+ - In its place are the four consistency claims the corpus test now makes, and here they run over
20
+ damaged bytes rather than six real files: the two index arrays partition the signals (each is
21
+ data or annotations, none is both, none is missing from both), each signal's `index` is its
22
+ position, the reported `headerByteLength` is the one its own signal count implies, `ok` is
23
+ exactly "no error-severity diagnostic", and `bytesRead` exceeds neither the file nor the 128 KiB
24
+ ceiling. All of them hold today under bit flips, truncation at every length, and uniformly
25
+ random bytes.
26
+ - Everything from `header !== undefined` onwards is skipped when triage could not parse one, and
27
+ random bytes almost never produce one — so the run now counts how many reports came back with a
28
+ header and asserts the count. A run that got past that line zero times would report green having
29
+ checked only that nothing threw, which is how the assertion it replaces survived.
30
+ - The suite-size figure moves from 2,500 to 2,700, in the three places that state it — the README's
31
+ status line, the foot of `installation.md`, and the docblock of `browser-safety.test.ts`. The
32
+ tests added over 0.4.520-0.4.522 pushed the written-out count past it, which is the direction
33
+ `test-count-claims.test.ts` exists to catch: "N or more" stays true forever once it is true, so
34
+ the property that makes it safe is the property that makes it worthless. It refused the release
35
+ rather than letting the number quietly describe a smaller repository.
36
+
37
+ ## 0.4.522
38
+
39
+ - **Added** the reading/scaling/decimating agreement checks to the offline suite — the third group
40
+ in `tests/corpus/whole-api.test.ts`, which skips without the corpus. These are four calls a
41
+ viewer makes in sequence: read a window, join the chunks, convert to units, draw a decimated
42
+ envelope. Each can be individually right while contradicting the one before it.
43
+ - The envelope is where that bites. `readEnvelope` reads and reduces on its own path rather than
44
+ decimating what `readWindow` returned, so its extremes and the samples' extremes are two
45
+ independent answers to the same question about the same window, and only comparing them says
46
+ they agree.
47
+ - Running it on built files covers more than running it on real ones. The shapes include a file
48
+ with no data signal at all and one with a zero record duration, where the honest answer to "read
49
+ a window of it" is nothing — and a helper that returns nothing where its neighbour throws is
50
+ exactly the disagreement this group exists to find. The corpus reaches those shapes by luck.
51
+ - Every case returns early on a file it cannot apply to, so the file ends by asserting how many
52
+ times it got through: windows read, envelopes compared, samples located. Without that the whole
53
+ run could return early and report green.
54
+ - The **annotation-helper** group lands with it, since it is the same argument about a different
55
+ four calls: a census, a text filter, a formatter and two time lookups, all describing one list.
56
+ Each is asked about every event's OWN onset, which puts every event on the boundary of the
57
+ half-open interval it is being looked for in rather than hoping one lands there — and half-open
58
+ boundaries are where five of the comparisons this project has had to fix went wrong. Four of the
59
+ eight shapes carry no annotations channel, and two empty lists agree about everything, so that
60
+ file also counts the events it reached.
61
+
9
62
  ## 0.4.521
10
63
 
11
64
  - **Added** the timeline-helper agreement checks to the offline suite, the second group in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.4.521",
3
+ "version": "0.4.523",
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.4.521';
96
+ export const VERSION = '0.4.523';