@diafunc/cli 0.32.2 → 0.32.4

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.
@@ -4,13 +4,13 @@ import {
4
4
  PromptCanceled,
5
5
  createProgram,
6
6
  handleError
7
- } from "../chunk-FERQPITK.js";
7
+ } from "../chunk-BTYMTKQ5.js";
8
8
  import {
9
9
  getUpdateNotice
10
- } from "../chunk-TARRZIGI.js";
10
+ } from "../chunk-ZAYRKIOM.js";
11
11
  import {
12
12
  package_default
13
- } from "../chunk-BXPKOLZA.js";
13
+ } from "../chunk-DLSVOPIW.js";
14
14
 
15
15
  // bin/diafunc.ts
16
16
  import chalk2 from "chalk";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "./chunk-BXPKOLZA.js";
3
+ } from "./chunk-DLSVOPIW.js";
4
4
 
5
5
  // src/index.ts
6
6
  import chalk42 from "chalk";
@@ -8555,7 +8555,7 @@ var HELP = [
8555
8555
  ];
8556
8556
  async function runChatRepl(options) {
8557
8557
  const { input: promptInput } = await import("@inquirer/prompts");
8558
- const { getUpdateNotice } = await import("./update-check-NBOU2XBP.js");
8558
+ const { getUpdateNotice } = await import("./update-check-5OWPB35K.js");
8559
8559
  let sessionId = options.session;
8560
8560
  let lastReportedSession;
8561
8561
  console.log(chalk21.bold("Diafunc chat") + chalk21.dim(" \xB7 /help for commands, /quit to exit"));
@@ -10406,16 +10406,19 @@ function dataShape(rows, columns) {
10406
10406
  }
10407
10407
  function qualityText(analysis, verdict) {
10408
10408
  if (verdict?.validity === "not_valid") return "not shown: the result is not valid";
10409
+ if (analysis.tooLittleData === true) return TOO_LITTLE_DATA;
10409
10410
  const figure = analysis.heldOutQuality != null ? qualityPercent(analysis.heldOutQuality) + rowsText(analysis.heldOutRows, analysis.searchRows) : analysis.resultRunQuality != null ? `${qualityPercent(analysis.resultRunQuality)} on the training rows` : null;
10410
10411
  if (figure == null) return null;
10411
10412
  return verdict?.validity === "needs_review" ? `${figure}, needs review` : figure;
10412
10413
  }
10414
+ var TOO_LITTLE_DATA = "not shown: too few rows to judge the formula on rows it never saw";
10413
10415
  function targetResultsText(analysis) {
10414
10416
  const results = analysis.targetResults ?? [];
10415
10417
  if (results.length === 0) return null;
10418
+ const withheld = analysis.tooLittleData === true;
10416
10419
  const lines = results.map((r) => {
10417
10420
  const name = r.title ?? r.target ?? "target";
10418
- return r.quality != null ? `${name}: ${qualityPercent(r.quality)}${rowsText(r.heldOutRows, r.searchRows)}` : name;
10421
+ return r.quality != null && !withheld ? `${name}: ${qualityPercent(r.quality)}${rowsText(r.heldOutRows, r.searchRows)}` : name;
10419
10422
  });
10420
10423
  const more = (analysis.targetResultCount ?? results.length) - results.length;
10421
10424
  if (more > 0) lines.push(`and ${formatNumber(more)} more`);
@@ -12822,20 +12825,24 @@ function deploymentNotFound(error, deploymentId, predictionId) {
12822
12825
  function isNotEnoughCredits(error) {
12823
12826
  return error instanceof ApiError && error.status === 402;
12824
12827
  }
12828
+ function inputName(input) {
12829
+ return input.title || input.input;
12830
+ }
12825
12831
  function checkWords(check) {
12832
+ const name = inputName(check);
12826
12833
  const range = check.observedMin !== null && check.observedMin !== void 0 && check.observedMax !== null && check.observedMax !== void 0 ? ` (observed ${num(check.observedMin)} to ${num(check.observedMax)})` : "";
12827
12834
  const value = check.value === null || check.value === void 0 ? "" : ` = ${String(check.value)}`;
12828
12835
  switch (check.kind) {
12829
12836
  case "below_range":
12830
- return `${check.input}${value}, below the observed range${range}`;
12837
+ return `${name}${value}, below the observed range${range}`;
12831
12838
  case "above_range":
12832
- return `${check.input}${value}, above the observed range${range}`;
12839
+ return `${name}${value}, above the observed range${range}`;
12833
12840
  case "unseen_level":
12834
- return `${check.input}${value}, a level the model was not found on`;
12841
+ return `${name}${value}, a level the model was not found on`;
12835
12842
  case "missing":
12836
- return `${check.input}, not sent or not readable`;
12843
+ return `${name}, not sent or not readable`;
12837
12844
  default:
12838
- return `${check.input}${value}, ${words(check.kind)}`;
12845
+ return `${name}${value}, ${words(check.kind)}`;
12839
12846
  }
12840
12847
  }
12841
12848
  function predictionLines(deploymentId, answer) {
@@ -12866,7 +12873,7 @@ function predictionLines(deploymentId, answer) {
12866
12873
  }
12867
12874
  function inputRow(i) {
12868
12875
  return {
12869
- input: i.input === "@prediction" ? "(predictions)" : i.input,
12876
+ input: i.input === "@prediction" ? "(predictions)" : inputName(i),
12870
12877
  state: words(i.state),
12871
12878
  psi: i.psi === null || i.psi === void 0 ? null : num(i.psi),
12872
12879
  outOfRange: i.outOfRange > 0 ? `${count(i.outOfRange)} (${percent2(i.outOfRangeShare)})` : "0",
@@ -12984,7 +12991,7 @@ function printDeployment(deployment, outputFormat) {
12984
12991
  if (outputFormat === "human" && (deployment.inputRanges ?? []).length > 0) {
12985
12992
  heading("Inputs on the rows the model was found on");
12986
12993
  for (const r of deployment.inputRanges ?? []) {
12987
- detail(r.kind === "categorical" ? `${r.input}: ${(r.levels ?? []).join(", ") || ABSENT}` : `${r.input}: ${num(r.min)} to ${num(r.max)}, median ${num(r.median)}`);
12994
+ detail(r.kind === "categorical" ? `${inputName(r)}: ${(r.levels ?? []).join(", ") || ABSENT}` : `${inputName(r)}: ${num(r.min)} to ${num(r.max)}, median ${num(r.median)}`);
12988
12995
  }
12989
12996
  }
12990
12997
  }
@@ -15125,7 +15132,7 @@ function registerShellCommand(program) {
15125
15132
  });
15126
15133
  const api = createApiClient();
15127
15134
  const { input: promptInput } = await import("@inquirer/prompts");
15128
- const { getUpdateNotice } = await import("./update-check-NBOU2XBP.js");
15135
+ const { getUpdateNotice } = await import("./update-check-5OWPB35K.js");
15129
15136
  const resolvedLanguage = await resolveLanguage(api, fnRef.projectId, options.language);
15130
15137
  console.log(chalk37.bold("Diafunc shell") + chalk37.dim(` \xB7 function ${fnRef.entityId} \xB7 ${resolvedLanguage}`));
15131
15138
  console.log(chalk37.dim(`Endpoint: ${config.profiles[getActiveProfileName(config)]?.endpoint}`));
@@ -15936,4 +15943,4 @@ export {
15936
15943
  PromptCanceled,
15937
15944
  createProgram
15938
15945
  };
15939
- //# sourceMappingURL=chunk-FERQPITK.js.map
15946
+ //# sourceMappingURL=chunk-BTYMTKQ5.js.map