edfcore 0.5.14 → 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.
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/docs/CHANGELOG.md +51 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -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.
|
|
112
|
+
export declare const VERSION = "0.5.16";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,57 @@ 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
|
+
|
|
38
|
+
## 0.5.15
|
|
39
|
+
|
|
40
|
+
- **Added** direct tests for `floorDiv` and `ceilDiv`, which had none. `tal/ticks.ts` owns them, and
|
|
41
|
+
`ticks.test.ts` — the file named for that module — covers the onset parsers and the tick
|
|
42
|
+
conversions and neither of these. Five modules import them: `envelope.ts`, `biosemi.ts`,
|
|
43
|
+
`format-annotations.ts`, `sample-locate.ts` and `time/window.ts`. Every assertion they had was
|
|
44
|
+
incidental, made through a caller that happens to divide.
|
|
45
|
+
- The whole content of both functions is the negative side. Bigint `/` truncates toward zero, so on
|
|
46
|
+
a negative numerator it is neither floor nor ceiling. Both are now checked against `Math.floor`
|
|
47
|
+
and `Math.ceil` over a grid crossing zero — 85 cells, small enough that float division is an exact
|
|
48
|
+
oracle — with `ceilDiv(a, b) === -floorDiv(-a, b)` asserted across it so the pair cannot drift
|
|
49
|
+
apart. The operator is then shown to disagree on every negative non-multiple **and only there**,
|
|
50
|
+
which is what stops the grid from proving nothing.
|
|
51
|
+
- The docblock's reason for their living in `ticks.ts` — "three modules had grown their own copies
|
|
52
|
+
of the same four lines" — is enumerated out of `src/`: exactly one module declares them, five
|
|
53
|
+
call them, and each of the five imports them rather than redeclaring.
|
|
54
|
+
- The last block pins the operand that makes this ordinary rather than an edge case. `trimToWindow`
|
|
55
|
+
selects sample `j` through `floorDiv((R - 1) * S, D) + 1`, and a window beginning at its own
|
|
56
|
+
chunk's start makes `R` zero — so the numerator is `-S`, negative for every file, with no unusual
|
|
57
|
+
geometry and nothing pre-stimulus about it. Truncation there returns `1` where the floor returns
|
|
58
|
+
`0`, and the window loses the first sample the caller aligned it to.
|
|
59
|
+
|
|
9
60
|
## 0.5.14
|
|
10
61
|
|
|
11
62
|
- **Added** the CLI's default print cap driven at all four places it is applied.
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED