edfcore 0.2.19 → 0.2.20
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 +11 -0
- package/dist/annotations-query.d.ts.map +1 -1
- package/dist/annotations-query.js +11 -2
- package/dist/annotations-query.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/package.json +1 -1
- package/src/annotations-query.ts +11 -4
- package/src/constants.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,17 @@ 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.2.20
|
|
10
|
+
|
|
11
|
+
- **Fixed** `filterAnnotationsByTime` dropping an annotation whose duration was written as an
|
|
12
|
+
explicit `0`. A TAL spells an instant either by omitting the duration field or by writing `0`;
|
|
13
|
+
the two are the same instant, and the docs say edfcore does not distinguish them. The left-edge
|
|
14
|
+
clause keyed on `durationTicks === undefined` — a fact about the writer, not the event — so an
|
|
15
|
+
explicitly-zero marker fell out of the window starting at its own onset AND out of the window
|
|
16
|
+
before it, belonging to no window at all in an adjacent-window partition. It also disagreed with
|
|
17
|
+
`annotationsAt`, which had always treated the two spellings alike. The clause now tests the
|
|
18
|
+
event's actual duration; positive-duration events and the half-open rule are untouched.
|
|
19
|
+
|
|
9
20
|
## 0.2.19
|
|
10
21
|
|
|
11
22
|
- **Fixed** `mergeChunks` merging across a real gap whenever the index had not been scanned — the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations-query.d.ts","sourceRoot":"","sources":["../src/annotations-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,MAAM,EAAE,mBAAmB,GAC1B,SAAS,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"annotations-query.d.ts","sourceRoot":"","sources":["../src/annotations-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,MAAM,EAAE,mBAAmB,GAC1B,SAAS,aAAa,EAAE,CAsB1B;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GACnD,SAAS,aAAa,EAAE,CAQ1B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,SAAS,aAAa,EAAE,GACpC,aAAa,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAQlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,OAAO,EAAE,MAAM,GACd,SAAS,aAAa,EAAE,CAS1B"}
|
|
@@ -35,8 +35,17 @@ export function filterAnnotationsByTime(annotations, window) {
|
|
|
35
35
|
return Object.freeze(annotations.filter((annotation) => {
|
|
36
36
|
const onset = annotation.onsetTicksFromFirstRecord;
|
|
37
37
|
const end = onset + (annotation.durationTicks ?? 0n);
|
|
38
|
-
// Half-open on both sides: [onset, end) against [from, to).
|
|
39
|
-
|
|
38
|
+
// Half-open on both sides: [onset, end) against [from, to). An instantaneous event has an
|
|
39
|
+
// empty interval, so `end > from` can never hold for one and it needs the second clause.
|
|
40
|
+
//
|
|
41
|
+
// That clause tests `end === onset` — the event's actual duration — and NOT
|
|
42
|
+
// `durationTicks === undefined`, which is a fact about the WRITER rather than the event. A
|
|
43
|
+
// TAL may spell an instant either by omitting the duration field or by writing `0`, the two
|
|
44
|
+
// are the same instant, and `annotations.md` says edfcore does not distinguish them. Keying
|
|
45
|
+
// on the spelling dropped every explicitly-zero event from the window starting at its own
|
|
46
|
+
// onset — and from the previous window too, so in an adjacent-window partition it belonged
|
|
47
|
+
// to no window at all (fixed in 0.2.20).
|
|
48
|
+
return onset < to && (end > from || (end === onset && onset >= from));
|
|
40
49
|
}));
|
|
41
50
|
}
|
|
42
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations-query.js","sourceRoot":"","sources":["../src/annotations-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CACrC,WAAqC,EACrC,MAA2B;IAE3B,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACjD,MAAM,EAAE,GAAG,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACzD,IAAI,EAAE,IAAI,IAAI;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAEzC,OAAO,MAAM,CAAC,MAAM,CAClB,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE;QAChC,MAAM,KAAK,GAAG,UAAU,CAAC,yBAAyB,CAAC;QACnD,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC,UAAU,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;QACrD,
|
|
1
|
+
{"version":3,"file":"annotations-query.js","sourceRoot":"","sources":["../src/annotations-query.ts"],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C,KAAK,IAAI,EAAE,IAAI,EAAE,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC/E,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
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.2.
|
|
112
|
+
export declare const VERSION = "0.2.20";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/package.json
CHANGED
package/src/annotations-query.ts
CHANGED
|
@@ -42,10 +42,17 @@ export function filterAnnotationsByTime(
|
|
|
42
42
|
annotations.filter((annotation) => {
|
|
43
43
|
const onset = annotation.onsetTicksFromFirstRecord;
|
|
44
44
|
const end = onset + (annotation.durationTicks ?? 0n);
|
|
45
|
-
// Half-open on both sides: [onset, end) against [from, to).
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
// Half-open on both sides: [onset, end) against [from, to). An instantaneous event has an
|
|
46
|
+
// empty interval, so `end > from` can never hold for one and it needs the second clause.
|
|
47
|
+
//
|
|
48
|
+
// That clause tests `end === onset` — the event's actual duration — and NOT
|
|
49
|
+
// `durationTicks === undefined`, which is a fact about the WRITER rather than the event. A
|
|
50
|
+
// TAL may spell an instant either by omitting the duration field or by writing `0`, the two
|
|
51
|
+
// are the same instant, and `annotations.md` says edfcore does not distinguish them. Keying
|
|
52
|
+
// on the spelling dropped every explicitly-zero event from the window starting at its own
|
|
53
|
+
// onset — and from the previous window too, so in an adjacent-window partition it belonged
|
|
54
|
+
// to no window at all (fixed in 0.2.20).
|
|
55
|
+
return onset < to && (end > from || (end === onset && onset >= from));
|
|
49
56
|
}),
|
|
50
57
|
);
|
|
51
58
|
}
|
package/src/constants.ts
CHANGED