@finbheara/archive-client 0.47.0 → 0.49.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 CHANGED
@@ -96,6 +96,8 @@ c.features; // [{ feature: "dancers", state: "full" | "missing", missing: [...
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
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 |
100
+ | `results.round_points_printed`, `majors.round_points_printed` | the `round_points_printed` a row of `results.stream` and `results.entries` carries (the per-round points a platform served, FeisFWD's, in its slot order, a slot served nothing in null); absent, never refused, without it | 350 |
99
101
  | `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 |
100
102
  | `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 |
101
103
  | `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 |
@@ -634,6 +636,13 @@ competition beside its own fields: `competition`, `event`, `year`, `tier`, `comp
634
636
  `(file, line)` is one row, where an `address` may carry one row per section). Rows come in the
635
637
  release's own order, a competition's rows together.
636
638
 
639
+ THE PER-ROUND POINTS A PLATFORM SERVED, where the release carries them
640
+ (`rel.capability("results.round_points_printed")`): `round_points_printed`, FeisFWD's
641
+ served round points in its own slot order, each value a string as served and a slot it served
642
+ nothing in null (`[null, null, "275"]`). No slot is mapped onto a round and nothing is summed;
643
+ null where no slot serves a value and on every other source's row. `points_printed` stays the one
644
+ all-round figure a page prints.
645
+
637
646
  THE COMPETITION FIELDS, where the release carries them (`rel.capability("results.stream.competition")`,
638
647
  `"majors.stream.competition"` for scope `majors`), are on every row, null meaning no value:
639
648
 
@@ -644,7 +653,7 @@ THE COMPETITION FIELDS, where the release carries them (`rel.capability("results
644
653
  | `dance` | the competition's one dance as the release reads it (`reel`), null where it reads none |
645
654
  | `recalled_only` | true where the page printed the recalled dancers only |
646
655
  | `comp_flags` | what the page printed about itself, int-packed, one bit a flag (bit 10: recalled only). The release's `DATA-DICTIONARY.md` carries the register of every bit, and a published bit never moves |
647
- | `competitors_basis` | what `competitors` stands on: `printed` (the page printed a competed count), `counted` (the page printed the whole field, its cards counted), `net-entered` (FeisWeb: the entered count less the withdrawn one, who danced), `awards` (FeisWeb: the fewest dancers its `Awards To Top N Finishers ( p% )` line is a share of, who danced), `entered` or `registered` (only the top was printed: the page's entered or registered count, a REGISTRATION figure holding the no-shows), `estimated` (a majors sheet with no count that does not show its whole field: the recall rule over a recall-only sheet (twice the recalled, plus or minus 1, or the recalled where fewer than 10), else the dancers it printed, a FLOOR; never a count, so leave it out where a real count is needed), null where there is no number |
656
+ | `competitors_basis` | what `competitors` stands on: `printed` (the page printed a competed count), `counted` (the page printed the whole field, its cards counted), `net-entered` (FeisWeb: the entered count less the withdrawn one, who danced), `awards` (FeisWeb: the fewest dancers its `Awards To Top N Finishers ( p% )` line is a share of, who danced), `entered` or `registered` (only the top was printed: the page's entered or registered count, a REGISTRATION figure holding the no-shows), `estimated` (a majors sheet with no count that does not show its whole field: the recall rule over a recall-only sheet (twice the recalled, plus or minus 1, or the recalled where fewer than 10), else the dancers it printed, a FLOOR; never a count, so leave it out where a real count is needed), `placed` (the page's count fell below the last place of its placed run, so the field is that place: a dancer placed N-th proves N danced; a competed count), null where there is no number |
648
657
 
649
658
  A release without them streams every row with the six fields ABSENT, never null.
650
659
 
@@ -654,6 +663,8 @@ A release without them streams every row with the six fields ABSENT, never null.
654
663
 
655
664
  `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`).
656
665
 
666
+ `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.
667
+
657
668
  THE COMPETITION'S KEY is `competition` (`<event-year>.<comp>` at a major, `<platform>:<host>.<comp>`
658
669
  at a feis), which holds across releases. Inside one release `(file, competition_line)` is exact: a
659
670
  competition captured twice (two files of one platform) carries one `competition` in both and two
@@ -570,6 +570,30 @@ var FEATURES2 = [
570
570
  since: 345,
571
571
  calls: "the same on a row of results.stream and results.entries (scope majors)"
572
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
+ },
585
+ {
586
+ feature: "results.round_points_printed",
587
+ needs: ["results:results.round_points_printed"],
588
+ since: 350,
589
+ calls: "the `round_points_printed` a row of results.stream and results.entries carries (the per-round points a platform served, FeisFWD's, in its slot order, a slot served nothing in null): absent, never refused, on a release without it"
590
+ },
591
+ {
592
+ feature: "majors.round_points_printed",
593
+ needs: ["majors:results.round_points_printed"],
594
+ since: 350,
595
+ calls: "the same on a row of results.stream and results.entries (scope majors)"
596
+ },
573
597
  {
574
598
  feature: "majors.attach_basis",
575
599
  needs: ["majors:results.attach_basis"],
@@ -1516,7 +1540,7 @@ function streamSql(q, shape = {}) {
1516
1540
  if (q.major !== undefined)
1517
1541
  where.push(q.major ? "r.major = 1" : "r.major = 0");
1518
1542
  return {
1519
- 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" : ""} 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`,
1543
+ 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" : ""}${shape.roundPoints === true ? ", r.round_points_printed AS round_points_printed" : ""} 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`,
1520
1544
  args
1521
1545
  };
1522
1546
  }
@@ -1528,7 +1552,7 @@ function feisDates(db) {
1528
1552
  }
1529
1553
  var text = (v) => v === null || v === "" ? null : v;
1530
1554
  function rowOf(r, dates) {
1531
- const { atts, withdrawn, recalled_only, ...rest } = r;
1555
+ const { atts, withdrawn, recalled_only, round_points_printed, ...rest } = r;
1532
1556
  const d = dates.get(r.event);
1533
1557
  return {
1534
1558
  ...rest,
@@ -1542,6 +1566,9 @@ function rowOf(r, dates) {
1542
1566
  feis_date_lo: d?.lo ?? null,
1543
1567
  feis_date_hi: d?.hi ?? null,
1544
1568
  atts: atts === "" ? [] : atts.split(","),
1569
+ ...round_points_printed === undefined ? {} : {
1570
+ round_points_printed: round_points_printed === null ? null : JSON.parse(round_points_printed)
1571
+ },
1545
1572
  withdrawn: text(withdrawn),
1546
1573
  qualifier: text(rest.qualifier),
1547
1574
  primary_source: text(rest.primary_source),
@@ -1664,9 +1691,11 @@ class ResultFinder2 {
1664
1691
  if (q.major !== undefined)
1665
1692
  await this.rel.require(`${db}.major`);
1666
1693
  const major = (await this.rel.capability(`${db}.major`)).state === "full";
1694
+ const relativePlaceErr = (await this.rel.capability(`${db}.relative_place_err`)).state === "full";
1695
+ const roundPoints = (await this.rel.capability(`${db}.round_points_printed`)).state === "full";
1667
1696
  return {
1668
1697
  db: this.rel.db(db),
1669
- shape: { competition, competitorsPrinted, attachBasis, major }
1698
+ shape: { competition, competitorsPrinted, attachBasis, major, relativePlaceErr, roundPoints }
1670
1699
  };
1671
1700
  }
1672
1701
  async* stream(q) {
package/dist/cli.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  staleWarning2,
24
24
  progressMode2,
25
25
  progressRenderer2
26
- } from "./chunks/index-f9hvd661.js";
26
+ } from "./chunks/index-9wetmb53.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
@@ -85,7 +85,7 @@ import {
85
85
  PROGRESS_MODES2,
86
86
  progressMode2,
87
87
  progressRenderer2
88
- } from "./chunks/index-f9hvd661.js";
88
+ } from "./chunks/index-9wetmb53.js";
89
89
  import {
90
90
  cacheRoot2,
91
91
  repoOf2
@@ -48,6 +48,7 @@ export interface StreamRow extends Partial<StreamCompetition> {
48
48
  place_printed: string;
49
49
  tie: number;
50
50
  relative_place: number | null;
51
+ relative_place_err?: number | null;
51
52
  atts: string[];
52
53
  withdrawn: string | null;
53
54
  qualifier: string | null;
@@ -63,6 +64,7 @@ export interface StreamRow extends Partial<StreamCompetition> {
63
64
  yob: number | null;
64
65
  yob_printed: string | null;
65
66
  points_printed: string | null;
67
+ round_points_printed?: (string | null)[] | null;
66
68
  platform_dancer_id: string | null;
67
69
  primary_source: string | null;
68
70
  file: string;
@@ -77,6 +79,8 @@ export interface StreamShape {
77
79
  competitorsPrinted?: boolean;
78
80
  attachBasis?: boolean;
79
81
  major?: boolean;
82
+ relativePlaceErr?: boolean;
83
+ roundPoints?: boolean;
80
84
  }
81
85
  export declare const scopeDb: (s: StreamScope) => "majors" | "results";
82
86
  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.47.0",
3
+ "version": "0.49.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",