edfcore 0.5.15 → 0.5.16

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.15";
112
+ export declare const VERSION = "0.5.16";
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.15';
82
+ export const VERSION = '0.5.16';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,35 @@ 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.16
10
+
11
+ - **Added** the last program on `annotations.md`, run. That page ends with the conversion it exists
12
+ to teach — an event onset to a sample index, in integers, because `Math.round(onset * sampleRateHz)`
13
+ drifts and the rate is `undefined` outright when the record duration is zero. It is thirty lines,
14
+ it prints two lines of output, and it is the thing a reader copies. `annotations-page.test.ts`
15
+ runs the top of the page and stops before it.
16
+ - The fixture is the page's own file, reconstructed from numbers the page already prints elsewhere
17
+ on it: `region.recordByteOffset` is 768, so the data signals hold 384 two-byte samples a record,
18
+ and the worked example's `256n` at one second fixes `EEG Fpz-Cz` at 256 of them, leaving 128 for
19
+ the second channel. One fixture now produces the four-event transcript at the top and the two
20
+ output lines at the bottom, both compared against text read out of the page.
21
+ - The printed float turns out to be load-bearing. `0.007629510948348211` is `bitValue * offset` on a
22
+ ±500 µV signal against the standard 16-bit digital range — the physical value of digital zero,
23
+ which is the first sample of every record — and it is printed twice because both events land on a
24
+ record boundary. It is asserted as that expression rather than as sixteen copied digits.
25
+ - Four claims in the prose under the program are checked with it. The `floorDiv` the page tells you
26
+ to write is compared character for character against the body of `floorDiv` in `src/tal/ticks.ts`.
27
+ Step 4's own recommendation — that `firstSampleIndex` comes back as `recordIndex x samplesPerRecord`
28
+ — is asserted rather than assumed. The floor "matters for negative onsets" is checked off the
29
+ sample grid, where the sentence has content: the page's own `-0.75` is an exact multiple at 256
30
+ samples a second, so both roundings agree on it, and a `-0.7501` onset is where truncation lands
31
+ one sample later, toward the file start, exactly as the page says.
32
+ - The Warning at the end is checked too, and it is the sharpest of the four. On an EDF+D file with a
33
+ five-second hole the formula answers for an instant inside it with `640n` — an ordinary index,
34
+ well inside the samples the file holds — while `index.locate(2.5)` correctly returns `undefined`.
35
+ For an instant past the gap that IS in the file, the formula names record 7 in a four-record file
36
+ and the scanned index names record 2.
37
+
9
38
  ## 0.5.15
10
39
 
11
40
  - **Added** direct tests for `floorDiv` and `ceilDiv`, which had none. `tal/ticks.ts` owns them, and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.5.15",
3
+ "version": "0.5.16",
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.15';
96
+ export const VERSION = '0.5.16';