edfcore 0.6.23 → 0.6.24
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/dist/format-header.d.ts.map +1 -1
- package/dist/format-header.js +13 -2
- package/dist/format-header.js.map +1 -1
- package/docs/CHANGELOG.md +19 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/format-header.ts +15 -2
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.6.
|
|
112
|
+
export declare const VERSION = "0.6.24";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-header.d.ts","sourceRoot":"","sources":["../src/format-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH,OAAO,KAAK,EAAmB,SAAS,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAsElF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"format-header.d.ts","sourceRoot":"","sources":["../src/format-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH,OAAO,KAAK,EAAmB,SAAS,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAsElF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CA4IrF"}
|
package/dist/format-header.js
CHANGED
|
@@ -152,13 +152,24 @@ export function formatHeader(header, options) {
|
|
|
152
152
|
lines.push(`recording ${printable(trimEdfField(header.recording.raw)) || 'unknown'}`);
|
|
153
153
|
}
|
|
154
154
|
lines.push('');
|
|
155
|
+
/*
|
|
156
|
+
* Wide enough for the largest index in THIS file, never narrower than the three the heading has
|
|
157
|
+
* always used. EDF's signal-count field is four characters, so 9999 signals is a legal file and
|
|
158
|
+
* a thousand-channel one is an ordinary high-density recording — and a fixed width of three put
|
|
159
|
+
* signal 1000 one column to the right of signal 999, in the middle of the same table. Rows
|
|
160
|
+
* either side of that boundary had their last three columns in different places, which is worse
|
|
161
|
+
* than a table that is uniformly wrong: nothing about it looks like a formatting decision.
|
|
162
|
+
*
|
|
163
|
+
* A file with fewer than a thousand signals prints exactly what it printed before (0.6.24).
|
|
164
|
+
*/
|
|
165
|
+
const indexWidth = Math.max(3, `${Math.max(0, header.signals.length - 1)}`.length);
|
|
155
166
|
// Built from the SAME widths as the data rows below, not spaced by hand. The hand-spaced literal
|
|
156
167
|
// had one space too many after `label` and one after `kind`, so `kind` sat at column 27 over data
|
|
157
168
|
// at 26 and `rate` and `range` were two out — on every file, in the output whose whole purpose is
|
|
158
169
|
// being read in a terminal (fixed in 0.3.96).
|
|
159
|
-
lines.push(
|
|
170
|
+
lines.push(`${'#'.padStart(indexWidth)} ${'label'.padEnd(21)}${'kind'.padEnd(12)}${'rate'.padEnd(9)} range`);
|
|
160
171
|
for (const signal of header.signals) {
|
|
161
|
-
const index = String(signal.index).padStart(
|
|
172
|
+
const index = String(signal.index).padStart(indexWidth);
|
|
162
173
|
// Control characters are replaced, not printed. A label holding a newline would otherwise
|
|
163
174
|
// render as two rows and forge a signal the file does not contain; a tab would shift every
|
|
164
175
|
// column after it. EDF pads labels with spaces and says nothing about what else may be in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-header.js","sourceRoot":"","sources":["../src/format-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM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C;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,25 @@ 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.6.24
|
|
10
|
+
|
|
11
|
+
- **Fixed** the signal-index column being three characters wide whatever the file, so signal 1000
|
|
12
|
+
sat one column to the right of signal 999 — in the middle of the same table, with the rows either
|
|
13
|
+
side of that boundary putting their last three columns in different places. That is worse than a
|
|
14
|
+
table that is uniformly wrong: nothing about it looks like a formatting decision.
|
|
15
|
+
- EDF's signal-count field is four characters, so 9999 signals is a legal file, and a
|
|
16
|
+
thousand-channel recording is ordinary high-density work rather than a corner case. `inspect.ts`
|
|
17
|
+
already discusses a 512-signal file as the realistic one.
|
|
18
|
+
- The width comes from the largest index in the file and is never narrower than the three it has
|
|
19
|
+
always used, so every file with fewer than a thousand signals prints exactly what it printed
|
|
20
|
+
before. The heading is built from that width rather than spaced by hand, which is the rule 0.3.96
|
|
21
|
+
established for the other four columns.
|
|
22
|
+
- `a-rate-that-does-not-divide.test.ts` now reads the range column off the heading instead of from
|
|
23
|
+
a constant, which is what lets one property cover a width that depends on the file: every row's
|
|
24
|
+
`range` starts where the heading's does, on all thirteen shapes and on a 1200-signal file. The
|
|
25
|
+
0.6.23 rate fix and this one are the same defect in two columns — a value wider than the width it
|
|
26
|
+
was given — and they are checked by the same property now.
|
|
27
|
+
|
|
9
28
|
## 0.6.23
|
|
10
29
|
|
|
11
30
|
- **Fixed** a derived sample rate blowing the column it is printed in. `sampleRateHz` is
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/format-header.ts
CHANGED
|
@@ -165,13 +165,26 @@ export function formatHeader(header: EdfHeader, options?: FormatHeaderOptions):
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
lines.push('');
|
|
168
|
+
/*
|
|
169
|
+
* Wide enough for the largest index in THIS file, never narrower than the three the heading has
|
|
170
|
+
* always used. EDF's signal-count field is four characters, so 9999 signals is a legal file and
|
|
171
|
+
* a thousand-channel one is an ordinary high-density recording — and a fixed width of three put
|
|
172
|
+
* signal 1000 one column to the right of signal 999, in the middle of the same table. Rows
|
|
173
|
+
* either side of that boundary had their last three columns in different places, which is worse
|
|
174
|
+
* than a table that is uniformly wrong: nothing about it looks like a formatting decision.
|
|
175
|
+
*
|
|
176
|
+
* A file with fewer than a thousand signals prints exactly what it printed before (0.6.24).
|
|
177
|
+
*/
|
|
178
|
+
const indexWidth = Math.max(3, `${Math.max(0, header.signals.length - 1)}`.length);
|
|
168
179
|
// Built from the SAME widths as the data rows below, not spaced by hand. The hand-spaced literal
|
|
169
180
|
// had one space too many after `label` and one after `kind`, so `kind` sat at column 27 over data
|
|
170
181
|
// at 26 and `rate` and `range` were two out — on every file, in the output whose whole purpose is
|
|
171
182
|
// being read in a terminal (fixed in 0.3.96).
|
|
172
|
-
lines.push(
|
|
183
|
+
lines.push(
|
|
184
|
+
`${'#'.padStart(indexWidth)} ${'label'.padEnd(21)}${'kind'.padEnd(12)}${'rate'.padEnd(9)} range`,
|
|
185
|
+
);
|
|
173
186
|
for (const signal of header.signals) {
|
|
174
|
-
const index = String(signal.index).padStart(
|
|
187
|
+
const index = String(signal.index).padStart(indexWidth);
|
|
175
188
|
// Control characters are replaced, not printed. A label holding a newline would otherwise
|
|
176
189
|
// render as two rows and forge a signal the file does not contain; a tab would shift every
|
|
177
190
|
// column after it. EDF pads labels with spaces and says nothing about what else may be in
|