@finbheara/archive-client 0.46.0 → 0.48.0
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/README.md +6 -0
- package/dist/chunks/{index-kfc7hz90.js → index-yv5gx1xs.js} +35 -2
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/stream.d.ts +5 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -95,6 +95,8 @@ c.features; // [{ feature: "dancers", state: "full" | "missing", missing: [...
|
|
|
95
95
|
| `dancers.years` | `dancers.years` | 245 |
|
|
96
96
|
| `results.stream.competitors_printed`, `majors.stream.competitors_printed` | the `competitors_printed` a streamed row carries (the competed count the page printed); absent, never refused, without it | 345 |
|
|
97
97
|
| `results.attach_basis`, `majors.attach_basis` | the `attach_basis` a row of `results.query`, `majors.results`, `results.stream` and `results.entries` carries (how its `dancer_id` was answered, or why not); absent, never refused, without it | 345 |
|
|
98
|
+
| `results.major`, `majors.major` | the `major` a row of `results.stream` and `results.entries` carries (1 where its competition is a main event of a T1-T3 event, exactly the rows `majors.sqlite` holds); absent without it, and the stream filter `major` is refused by name without it | 345 |
|
|
99
|
+
| `results.relative_place_err`, `majors.relative_place_err` | the `relative_place_err` a row of `results.stream` and `results.entries` carries (how far below `relative_place` the true value may sit, 0 over an exact field); absent, never refused, without it | 350 |
|
|
98
100
|
| `dancers.records.birth_consistency`, `dancers.years.birth_consistency` | the `birth_consistency` (0-100, floored: the percent of the dancer's, or the dancer-year's, readable rows that fit the birth window) and its denominator `birth_consistency_rows` a record of `dancers.records` and a dancer-year of `dancers.years` carry; absent, never refused, without it | 345 |
|
|
99
101
|
| `dancers.records.birth_deadband`, `dancers.years.birth_deadband` | the `birth_deadband_rows` a record of `dancers.records` and a dancer-year of `dancers.years` carry (the readable rows a one-year dance-up alone keeps off the birth window, outside `birth_consistency` and its denominator); absent, never refused, without it | 345 |
|
|
100
102
|
| `dancers.years.printed` | the `printed_regions` a dancer-year of `dancers.years` carries (every region the year printed, where `region` picks one); absent, never refused, without it | 341 |
|
|
@@ -651,6 +653,10 @@ A release without them streams every row with the six fields ABSENT, never null.
|
|
|
651
653
|
|
|
652
654
|
`attach_basis` (feature `results.attach_basis`, `majors.attach_basis` for scope `majors` and `rel.majors.results`) says how a row's `dancer_id` was answered, or why it was not, in one integer: `attach_basis & 63` is the feis attach's outcome for the row's address (`0` on a majors row, `1` a platform row it carded no card for, else attached how or the gate that refused it), `attach_basis & ~63` the bits of where the id came from (none where `dancer_id` is null). `unpackAttachBasis(n)` decodes it, `{ outcome: "birth-window", via: ["feis-local"] }`, off the register `ATTACH_OUTCOMES` and `ATTACH_VIA` the package exports, and the release's `DATA-DICTIONARY.md` says what each value means. `rel.results.query` and `rel.majors.results` rows carry it too. A release without it returns the field ABSENT.
|
|
653
655
|
|
|
656
|
+
`major` (feature `results.major`, `majors.major` for scope `majors`) is 1 where the row's competition is a MAJOR'S MAIN EVENT: a solo championship (open or adult) or an either/or traditional set at a T1-T3 event, the competition a dancer came to the major for. A grade, a preliminary competition (a prelim-only one, or a prelim re-ranking of the open's field), a special, a traditional set co-entered with the championship, a mini championship beside its age group's full one and every feis row are 0. `majors.sqlite` holds exactly the 1s, so a reader of the full `results` set filters `rel.results.stream({ scope: "all", major: true })` to read what the majors stream reads. `tier` stays the event's. A release without the column returns the field absent and refuses the `major` filter by name (`needsRelease`).
|
|
657
|
+
|
|
658
|
+
`relative_place` is read over the LARGEST field the release admits for the competition, so first place is 100 over any field and a recalled dancer's value stays high on a recall list, and `relative_place_err` (feature `results.relative_place_err`, `majors.relative_place_err`) says how far below it the true value may sit: the true value lies in `[relative_place - relative_place_err, relative_place]`. It is 0 where the field is a counted or printed competed count (and on a first place, and over a registration count every entrant of which printed), larger over a registration count (its no-shows), a recall list (the field its cards admit) or a feis page printing no count (a field of up to 150). A consumer wanting only exact values filters `relative_place_err = 0`. A release without it returns the field absent.
|
|
659
|
+
|
|
654
660
|
THE COMPETITION'S KEY is `competition` (`<event-year>.<comp>` at a major, `<platform>:<host>.<comp>`
|
|
655
661
|
at a feis), which holds across releases. Inside one release `(file, competition_line)` is exact: a
|
|
656
662
|
competition captured twice (two files of one platform) carries one `competition` in both and two
|
|
@@ -558,6 +558,30 @@ var FEATURES2 = [
|
|
|
558
558
|
since: 345,
|
|
559
559
|
calls: "the `attach_basis` a row of results.query, results.stream and results.entries carries (how its dancer_id was answered, or why not): absent, never refused, on a release without it"
|
|
560
560
|
},
|
|
561
|
+
{
|
|
562
|
+
feature: "results.major",
|
|
563
|
+
needs: ["results:results.major", "results:competitions.major"],
|
|
564
|
+
since: 345,
|
|
565
|
+
calls: "the `major` a row of results.stream and results.entries carries (1 where its competition is a main event of a T1-T3 event, the rows majors.sqlite holds): absent on a release without it; the stream filter `major` is refused on a release without it"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
feature: "majors.major",
|
|
569
|
+
needs: ["majors:results.major", "majors:competitions.major"],
|
|
570
|
+
since: 345,
|
|
571
|
+
calls: "the same on a row of results.stream and results.entries (scope majors)"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
feature: "results.relative_place_err",
|
|
575
|
+
needs: ["results:results.relative_place_err"],
|
|
576
|
+
since: 350,
|
|
577
|
+
calls: "the `relative_place_err` a row of results.stream and results.entries carries (how far below relative_place the true value may sit, 0 over an exact field): absent, never refused, on a release without it"
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
feature: "majors.relative_place_err",
|
|
581
|
+
needs: ["majors:results.relative_place_err"],
|
|
582
|
+
since: 350,
|
|
583
|
+
calls: "the same on a row of results.stream and results.entries (scope majors)"
|
|
584
|
+
},
|
|
561
585
|
{
|
|
562
586
|
feature: "majors.attach_basis",
|
|
563
587
|
needs: ["majors:results.attach_basis"],
|
|
@@ -1501,8 +1525,10 @@ function streamSql(q, shape = {}) {
|
|
|
1501
1525
|
}
|
|
1502
1526
|
if (q.primary === true)
|
|
1503
1527
|
where.push("(r.primary_source IS NULL OR r.primary_source = '')");
|
|
1528
|
+
if (q.major !== undefined)
|
|
1529
|
+
where.push(q.major ? "r.major = 1" : "r.major = 0");
|
|
1504
1530
|
return {
|
|
1505
|
-
sql: `SELECT ${COLUMNS}${shape.competition === true ? COMPETITION_COLUMNS : ""}${shape.competitorsPrinted === true ? ", c.competitors_printed AS competitors_printed" : ""}${shape.attachBasis === true ? ", r.attach_basis AS attach_basis" : ""} FROM results r JOIN competitions c ON c.file = r.file AND c.line = r.competition_line${where.length === 0 ? "" : ` WHERE ${where.join(" AND ")}`} ORDER BY r.file, r.line`,
|
|
1531
|
+
sql: `SELECT ${COLUMNS}${shape.competition === true ? COMPETITION_COLUMNS : ""}${shape.competitorsPrinted === true ? ", c.competitors_printed AS competitors_printed" : ""}${shape.attachBasis === true ? ", r.attach_basis AS attach_basis" : ""}${shape.major === true ? ", r.major AS major" : ""}${shape.relativePlaceErr === true ? ", r.relative_place_err AS relative_place_err" : ""} FROM results r JOIN competitions c ON c.file = r.file AND c.line = r.competition_line${where.length === 0 ? "" : ` WHERE ${where.join(" AND ")}`} ORDER BY r.file, r.line`,
|
|
1506
1532
|
args
|
|
1507
1533
|
};
|
|
1508
1534
|
}
|
|
@@ -1647,7 +1673,14 @@ class ResultFinder2 {
|
|
|
1647
1673
|
const competition = (await this.rel.capability(`${db}.stream.competition`)).state === "full";
|
|
1648
1674
|
const competitorsPrinted = (await this.rel.capability(`${db}.stream.competitors_printed`)).state === "full";
|
|
1649
1675
|
const attachBasis = (await this.rel.capability(`${db}.attach_basis`)).state === "full";
|
|
1650
|
-
|
|
1676
|
+
if (q.major !== undefined)
|
|
1677
|
+
await this.rel.require(`${db}.major`);
|
|
1678
|
+
const major = (await this.rel.capability(`${db}.major`)).state === "full";
|
|
1679
|
+
const relativePlaceErr = (await this.rel.capability(`${db}.relative_place_err`)).state === "full";
|
|
1680
|
+
return {
|
|
1681
|
+
db: this.rel.db(db),
|
|
1682
|
+
shape: { competition, competitorsPrinted, attachBasis, major, relativePlaceErr }
|
|
1683
|
+
};
|
|
1651
1684
|
}
|
|
1652
1685
|
async* stream(q) {
|
|
1653
1686
|
const { db, shape } = await this.streamDb(q);
|
package/dist/cli.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
staleWarning2,
|
|
24
24
|
progressMode2,
|
|
25
25
|
progressRenderer2
|
|
26
|
-
} from "./chunks/index-
|
|
26
|
+
} from "./chunks/index-yv5gx1xs.js";
|
|
27
27
|
import"./chunks/index-hghdy980.js";
|
|
28
28
|
|
|
29
29
|
var USAGE_HEADER = "usage: idq <verb> [--cache <dir>] [--repo <owner/name>] [--json] [--live] [--progress tty|plain|none]";
|
package/dist/index.js
CHANGED
package/dist/types/stream.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface StreamQuery {
|
|
|
10
10
|
dancer_id?: number[];
|
|
11
11
|
school_id?: string;
|
|
12
12
|
primary?: boolean;
|
|
13
|
+
major?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export interface StreamCompetition {
|
|
15
16
|
competition_line: number;
|
|
@@ -47,6 +48,7 @@ export interface StreamRow extends Partial<StreamCompetition> {
|
|
|
47
48
|
place_printed: string;
|
|
48
49
|
tie: number;
|
|
49
50
|
relative_place: number | null;
|
|
51
|
+
relative_place_err?: number | null;
|
|
50
52
|
atts: string[];
|
|
51
53
|
withdrawn: string | null;
|
|
52
54
|
qualifier: string | null;
|
|
@@ -58,6 +60,7 @@ export interface StreamRow extends Partial<StreamCompetition> {
|
|
|
58
60
|
dancer_id: number | null;
|
|
59
61
|
dancer_scope: "per-release" | "stable" | null;
|
|
60
62
|
attach_basis?: number;
|
|
63
|
+
major?: 0 | 1;
|
|
61
64
|
yob: number | null;
|
|
62
65
|
yob_printed: string | null;
|
|
63
66
|
points_printed: string | null;
|
|
@@ -74,6 +77,8 @@ export interface StreamShape {
|
|
|
74
77
|
competition?: boolean;
|
|
75
78
|
competitorsPrinted?: boolean;
|
|
76
79
|
attachBasis?: boolean;
|
|
80
|
+
major?: boolean;
|
|
81
|
+
relativePlaceErr?: boolean;
|
|
77
82
|
}
|
|
78
83
|
export declare const scopeDb: (s: StreamScope) => "majors" | "results";
|
|
79
84
|
export declare function streamSql(q: StreamQuery, shape?: StreamShape): {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finbheara/archive-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"description": "Open a versioned release of an Irish dance results archive: download, verify, decompress and cache it by tag, keep the cache, and resolve feises and schools against it",
|
|
5
5
|
"keywords": ["irish-dance", "results", "release", "cache", "sqlite"],
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"prepublishOnly": "bun scripts/build.ts && bun ../../tools/checks/archive-client-tarball.ts"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@finbheara/domain": "0.
|
|
47
|
+
"@finbheara/domain": "0.59.0",
|
|
48
48
|
"@finbheara/names": "0.30.0",
|
|
49
49
|
"hyparquet": "1.31.2"
|
|
50
50
|
},
|