@mark1russell7/stack-endurance 0.8.36 → 0.8.38

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
@@ -333,4 +333,4 @@ In the sample, the rice needs 2 L of water for each kg. The drinking water holds
333
333
 
334
334
  ## The gate
335
335
 
336
- `checkEndurance(layer, stack)` gives the faults of a layer. `ENDURANCE_CODES` lists the codes. The gate finds two records with one key, and an unknown level, resource or part. It also finds a value out of range, a bad date, an empty converter and a bad survival curve. Converters that make a resource from itself are a cycle, and the gate refuses them. Two counts of devices for one device are a fault (`endurance-devices`). A device with a limited converter and a converter with no limit is a warning (`endurance-device-mix`), because the converter with no limit uses no device-days. A draw with no way to get its need is a warning, and a cut with no curve is a warning. A bad season is a fault (`endurance-season`). Bad shares `monthly` are a fault (`endurance-monthly`). A converter that takes nothing is a fault, but for a source with a limit `perDay` more than 0. A converter with a season is not part of a cycle, because its harvest comes after its sowing.
336
+ `checkEndurance(layer, stack)` gives the faults of a layer. `ENDURANCE_CODES` lists the codes. The gate finds two records with one key, and an unknown level, resource or part. It also finds a value out of range, a bad date, an empty converter and a bad survival curve. Converters that make a resource from itself are a cycle, and the gate refuses them. Two counts of devices for one device are a fault (`endurance-devices`). A device with a limited converter and a converter with no limit is a warning (`endurance-device-mix`), because the converter with no limit uses no device-days. A draw with no way to get its need is a warning, and a cut with no curve is a warning. A store whose resource no direct use and no converter takes is a warning (`endurance-store-unused`, since 0.8.37), because its amount adds no day. A bad season is a fault (`endurance-season`). Bad shares `monthly` are a fault (`endurance-monthly`). A converter that takes nothing is a fault, but for a source with a limit `perDay` more than 0. A converter with a season is not part of a cycle, because its harvest comes after its sowing.
package/build/add-on.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as checkEndurance, t as joinEndurance } from "./join-CsR-FKzr.js";
1
+ import { r as checkEndurance, t as joinEndurance } from "./join-DwYqzX7_.js";
2
2
  import { t as ENDURANCE_SCHEMA } from "./layer-a3Fr70Uh.js";
3
3
  import { parseEndurance } from "./schema.js";
4
4
  // src/add-on.ts
package/build/index.d.ts CHANGED
@@ -691,7 +691,7 @@ export interface CaseOutlook {
691
691
  */
692
692
  export declare function caseOutlook(layer: EnduranceLayer, caseCuts: CaseCuts, options: OutlookOptions): CaseOutlook;
693
693
  /**
694
- * These are the codes of the gate. Each code is an error, except `endurance-device-mix`, `endurance-no-way` and `endurance-cut-no-curve`, which are warnings.
694
+ * These are the codes of the gate. Each code is an error, except `endurance-device-mix`, `endurance-no-way`, `endurance-cut-no-curve` and `endurance-store-unused`, which are warnings.
695
695
  *
696
696
  * - `endurance-twice`: two or more records of one list have one key. A key is a level, a resource, a store, a need, a converter or a case.
697
697
  * The key of a prior is its case and its place. A converter takes each resource on one line, and a case cuts each part one time.
@@ -722,8 +722,10 @@ export declare function caseOutlook(layer: EnduranceLayer, caseCuts: CaseCuts, o
722
722
  * - `endurance-capacity`: the capacity of a store is not a finite number more than 0, or it is less than the amount.
723
723
  * Or a store with a capacity has a due date. Or a resource has a store with a capacity and a store with no capacity.
724
724
  * Since 0.8.21 (M2-solar-charge).
725
+ * - `endurance-store-unused` (warning): no direct use and no converter takes the resource of a store, so its amount adds no day.
726
+ * One fault names each such resource, at the resource. Since 0.8.37.
725
727
  */
726
- export declare const ENDURANCE_CODES: readonly ["endurance-twice", "endurance-level-unknown", "endurance-resource-unknown", "endurance-part-unknown", "endurance-range", "endurance-date", "endurance-converter-empty", "endurance-curve", "endurance-bound", "endurance-prior-case", "endurance-cycle", "endurance-devices", "endurance-device-mix", "endurance-no-way", "endurance-cut-no-curve", "endurance-season", "endurance-monthly", "endurance-capacity"];
728
+ export declare const ENDURANCE_CODES: readonly ["endurance-twice", "endurance-level-unknown", "endurance-resource-unknown", "endurance-part-unknown", "endurance-range", "endurance-date", "endurance-converter-empty", "endurance-curve", "endurance-bound", "endurance-prior-case", "endurance-cycle", "endurance-devices", "endurance-device-mix", "endurance-no-way", "endurance-cut-no-curve", "endurance-season", "endurance-monthly", "endurance-capacity", "endurance-store-unused"];
727
729
  /** A code of `ENDURANCE_CODES`. */
728
730
  export type EnduranceCode = (typeof ENDURANCE_CODES)[number];
729
731
  /** A fault of the gate of an endurance layer. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["CutBound"],"sources":["../src/converter.ts","../src/supply.ts","../src/calendar.ts","../src/endurance.ts","../src/joint.ts","../src/best.ts","../src/shortfall.ts","../src/check.ts","../src/join.ts","../src/sample.ts","../src/sensitivity.ts","../src/buy.ts"],"mappings":";;;;;;wBAegB,SAAS,WAAW;;wBAwBpB,SAAS,WAAW;;wBAKpB,aAAa,WAAW;;wBAKxB,cAAc,YAAY,SAAS,aAAa;;wBAOhD,QAAQ,QAAQ,wCAAwC,aAAa;;wBCnDrE,WAAW,MAAM,MAAM,UAAU;;UAKhC;WACN;WACA;WACA;WACA;;;UAIM;;WAEN,OAAO;WACP,UAAU;;WAEV,eAAe;;WAEf;;WAEA,OAAO;;;wBCZF,QAAQ,OAAO,SAAS;;;;;wBASxB,WAAW,OAAO,SAAS;;iBCX1B;;WAEN,IAAI;;WAEJ,QAAQ;;WAER;;;;;;WAMA,QAAQ;;;;;;WAMR;;;qBAIE;;;;;wBAMG,YAAY,UAAU,UAAU,SAAS,KAAK,iCAAiC;;;;;;;wBAqB/E,aAAa,OAAO,gBAAgB,IAAI,SAAS,eAAc,sBAAkC;;;;;wBAejG,UAAU,OAAO,gBAAgB,UAAU,UAAU,cAAc,sBAAsB;;;;;;;;wBAyMzF,QAAQ,QAAQ,KAAK,wBAAwB,OAAO,SAAS;;;;;wBAqG7D,aAAa,OAAO,gBAAgB,cAAc,qBAAqB,SAAS,cAAc;;;;;;wBAkB9F,UAAU,OAAO,gBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8C/C,YAAY,OAAO,gBAAgB,UAAU,UAAU,SAAS,cAAc;;iBC/a7E;WACN;WACA,IAAI;;;;;WAKJ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":["../src/converter.ts","../src/supply.ts","../src/calendar.ts","../src/endurance.ts","../src/joint.ts","../src/best.ts","../src/shortfall.ts","../src/check.ts","../src/join.ts","../src/sample.ts","../src/sensitivity.ts","../src/buy.ts"],"mappings":";;;;;;wBAegB,SAAS,WAAW;;wBAwBpB,SAAS,WAAW;;wBAKpB,aAAa,WAAW;;wBAKxB,cAAc,YAAY,SAAS,aAAa;;wBAOhD,QAAQ,QAAQ,wCAAwC,aAAa;;wBCnDrE,WAAW,MAAM,MAAM,UAAU;;UAKhC;WACN;WACA;WACA;WACA;;;UAIM;;WAEN,OAAO;WACP,UAAU;;WAEV,eAAe;;WAEf;;WAEA,OAAO;;;wBCZF,QAAQ,OAAO,SAAS;;;;;wBASxB,WAAW,OAAO,SAAS;;iBCX1B;;WAEN,IAAI;;WAEJ,QAAQ;;WAER;;;;;;WAMA,QAAQ;;;;;;WAMR;;;qBAIE;;;;;wBAMG,YAAY,UAAU,UAAU,SAAS,KAAK,iCAAiC;;;;;;;wBAqB/E,aAAa,OAAO,gBAAgB,IAAI,SAAS,eAAc,sBAAkC;;;;;wBAejG,UAAU,OAAO,gBAAgB,UAAU,UAAU,cAAc,sBAAsB;;;;;;;;wBAyMzF,QAAQ,QAAQ,KAAK,wBAAwB,OAAO,SAAS;;;;;wBAqG7D,aAAa,OAAO,gBAAgB,cAAc,qBAAqB,SAAS,cAAc;;;;;;wBAkB9F,UAAU,OAAO,gBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8C/C,YAAY,OAAO,gBAAgB,UAAU,UAAU,SAAS,cAAc;;iBC/a7E;WACN;WACA,IAAI;;;;;WAKJ;;WAEA;;WAEA;;;;;;WAMA,OAAO,SAAS,eAAe,SAAS;;;;;WAKxC;;WAEA,MAAM,SAAS;;;;;;WAMf;;WAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkCK,UAAU,OAAO,gBAAgB,UAAU,UAAU,SAAS,aAAa,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kB;;qBCblB;;;;;;qBAOA;;iBAGI,2BAA2B,aAAa;;WAE9C;;;;;WAKA;;;YAIC;;;;;;;;;iBAUK;;;;;;WAMN;WACA;WACA;;WAEA;;;iBAIM;WACN,OAAO;WACP,aAAa;WACb,OAAO;;;;;;iBAOD;;WAEN,QAAQ;;WAER,OAAO;;WAEP,QAAQ;;;;;;;;;;;;WAYR,WAAW;;;;;;;;;WASX,YAAY;;WAEZ,aAAa;;WAEb,YAAY;;;iBAIN;WACN;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA,SAAS;;;iBAIH;;;;;WAKN;WACA,MAAM;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,gBAAgB;;WAEhB,QAAQ,SAAS;;;iBAIX;WACN;WACA,IAAI;;WAEJ;;WAEA,MAAM;;WAEN,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0UZ,qBAAqB,OAAO,gBAAgB,UAAU,UAAU,SAAS,qBAAqB;;;;;;;iBCld7F;;WAEN;;WAEA,QAAQ,SAAS;;;iBAIX;;WAEN;;;YAIC;;iBAGK;WACN;WACA,MAAM;WACN;WACA;;WAEA;;WAEA,SAAS,SAAS;;WAElB,WAAW,SAAS;;;iBAId;WACN;WACA,MAAM;WACN;WACA;;WAEA,SAAS,SAAS;WAClB,QAAQ;;;iBAIF;WACN;WACA,IAAI;;WAEJ;;WAEA,iBAAiB;;WAEjB,mBAAmB;;WAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgDK,cAAc,aAAa,aAAa,QAAQ,YAAY,SAAS,uBAAuB"}
package/build/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { t as ENDURANCE_SCHEMA } from "./layer-a3Fr70Uh.js";
2
- import { a as hasEnduranceError, c as giftNeed, d as isSource, f as monthlyShares, i as curveFault, l as giftResource, n as ENDURANCE_CODES, o as canRun, p as shareOf, r as checkEndurance, s as deviceKey, t as joinEndurance, u as inputsOf } from "./join-CsR-FKzr.js";
2
+ import { a as hasEnduranceError, c as giftNeed, d as isSource, f as monthlyShares, i as curveFault, l as giftResource, n as ENDURANCE_CODES, o as canRun, p as shareOf, r as checkEndurance, s as deviceKey, t as joinEndurance, u as inputsOf } from "./join-DwYqzX7_.js";
3
3
  import { DEFAULT_MAX_SETS, STACK_SCHEMA, countsFault, dateOfDay, dayNumber, neededParts, stopSets, stopped, sumsFault, survivalAt, weakestBound } from "@mark1russell7/system-stack";
4
4
  import { ONE, ZERO, add, div, equals, fromFloat, mul, neg, sign, sub, toNumber } from "@mark1russell7/rational";
5
5
  import { solveLexicographic } from "@mark1russell7/linear";
6
6
  import { pathSetReliability, stronglyConnectedComponents } from "@mark1russell7/collections/graph";
7
7
  import { canonicalJson, seedOf } from "@mark1russell7/rigor-generators";
8
- import { Z95, greenwoodRead, kaplanMeier, survivalBootstrapMany, survivalCombination } from "@mark1russell7/rigor-statistics";
8
+ import { Z95, greenwoodRead, kaplanMeier, minimumInterval, survivalBootstrapMany, survivalCombination } from "@mark1russell7/rigor-statistics";
9
9
  // src/fit.ts
10
10
  /** The relative tolerance of a take and of a fit. */
11
11
  const TOLERANCE = 1e-13;
@@ -3552,21 +3552,15 @@ function upperTerms(early, late, lateAtHorizon) {
3552
3552
  /**
3553
3553
  * This function gives the interval of the change of the upper curve from the intervals of its terms (`upperTerms`).
3554
3554
  * Thus the interval holds also where the cap starts, where a percentile interval of the capped change is too narrow (M2-interval-kink-residual).
3555
- *
3556
- * - The low end is the minimum of the low ends. It is above the minimum only when the low end of the term that is the minimum is above that term.
3557
- * - When the high end of one term is below the low end of each other term, that term is the minimum. Its high end is the high end.
3558
- * - Else the terms can tie, and the high end can miss when one of them misses. Then the high end is the minimum of the high ends
3559
- * at the quantile 1 - alpha / 4 (`wideHigh`). Thus the two terms together miss at most alpha / 2 (Bonferroni).
3560
- * - At the horizon, the constant 1 is a term with the interval 1 to 1. A change down is the change up with the other sign.
3555
+ * The rule is `minimumInterval` of rigor-statistics (since 0.8.38). At a tie of the terms, it uses the high ends at the quantile 1 - alpha / 4 (`wideHigh`).
3556
+ * At the horizon, the constant 1 is a term with the interval 1 to 1. A change down is the change up with the other sign.
3561
3557
  */
3562
3558
  function upperInterval(terms, lateAtHorizon, up) {
3563
- const all = lateAtHorizon ? [...terms, {
3559
+ const { low, high } = minimumInterval(lateAtHorizon ? [...terms, {
3564
3560
  low: 1,
3565
3561
  high: 1,
3566
3562
  wideHigh: 1
3567
- }] : terms;
3568
- const low = Math.min(...all.map((term) => term.low));
3569
- const high = all.find((term, index) => all.every((other, at) => at === index || term.high < other.low))?.high ?? Math.min(...all.map((term) => term.wideHigh));
3563
+ }] : terms);
3570
3564
  return up ? {
3571
3565
  low,
3572
3566
  high