edf2csv 0.3.3 → 0.3.4
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/CHANGELOG.md +42 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,48 @@
|
|
|
3
3
|
Notable changes to edf2csv. Versions follow [semantic versioning](https://semver.org); while the
|
|
4
4
|
major version is 0, a minor bump may contain breaking changes.
|
|
5
5
|
|
|
6
|
+
## 0.3.4
|
|
7
|
+
|
|
8
|
+
### Added: `npm run crossvalidate`, the pyEDFlib comparison as something you can run
|
|
9
|
+
|
|
10
|
+
The README and the correctness page have both said the arithmetic is checked against an
|
|
11
|
+
independent implementation. That was true, and it was done by hand, which meant nothing
|
|
12
|
+
rechecked it when the code changed. It is now a command:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install pyedflib
|
|
16
|
+
npm run crossvalidate
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Compared 12,559 sample values across 77 recordings.
|
|
21
|
+
Every value agreed.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Why another implementation rather than another test: the digital-to-physical mapping is four
|
|
25
|
+
numbers out of the header and one multiply. It is easy to get subtly wrong and nearly
|
|
26
|
+
impossible to catch by reading, and a test written next to the code tends to encode the same
|
|
27
|
+
misunderstanding the code has. pyEDFlib was written by other people from the same
|
|
28
|
+
specification.
|
|
29
|
+
|
|
30
|
+
The recordings it generates are deliberately not the test fixtures. Those target what real
|
|
31
|
+
files get wrong, and pyEDFlib declines several of them — a truncated file, a header whose
|
|
32
|
+
digital range is a single point. These are the opposite: ordinary well-formed recordings
|
|
33
|
+
across a wide spread of calibrations, digital spans from `-1..1` to `-32768..32767` against
|
|
34
|
+
physical spans from `0.0001` to `99999`, which puts the gain anywhere from about 1e-9 to 1e5.
|
|
35
|
+
Both ends of the digital range appear in every one, because those are the two points the
|
|
36
|
+
header actually calibrates and where two derivations of the same mapping differ most.
|
|
37
|
+
|
|
38
|
+
The comparison runs at `--decimals 20` so that what is compared is two computations of a value
|
|
39
|
+
rather than one of them against its printed form. The first attempt used 12, where a reading
|
|
40
|
+
near 1e-5 keeps only seven significant digits and the rounding was larger than the
|
|
41
|
+
disagreement being looked for.
|
|
42
|
+
|
|
43
|
+
It is opt-in and not part of `npm test`, which stays dependency-free. Without pyEDFlib
|
|
44
|
+
installed it says so and exits 0 rather than reporting a pass it did not earn. Putting a
|
|
45
|
+
one-part-in-a-million error into the gain makes it exit 1 and name the sample, which is how
|
|
46
|
+
it was confirmed to be capable of failing at all.
|
|
47
|
+
|
|
6
48
|
## 0.3.3
|
|
7
49
|
|
|
8
50
|
### Fixed: a mistyped channel position converted a different channel
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edf2csv",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Convert EDF, EDF+ and BDF biosignal recordings (European Data Format) to CSV from the command line. Local, streaming, and never resamples or alters units.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"edf",
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
"fixtures": "node test/fixtures/generate.mjs",
|
|
61
61
|
"test": "npm run build && npm run fixtures && node --test test/*.test.js",
|
|
62
62
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
63
|
-
"prepublishOnly": "npm run clean && npm run build && npm test"
|
|
63
|
+
"prepublishOnly": "npm run clean && npm run build && npm test",
|
|
64
|
+
"crossvalidate": "npm run build && node test/crossvalidate/generate.mjs && python3 test/crossvalidate/compare.py"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@types/node": "^22.10.0",
|