corethink 1.0.3__tar.gz → 1.0.4__tar.gz

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.
Files changed (68) hide show
  1. {corethink-1.0.3 → corethink-1.0.4}/PKG-INFO +1 -1
  2. {corethink-1.0.3 → corethink-1.0.4}/pyproject.toml +1 -1
  3. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/_version.py +1 -1
  4. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/train.py +13 -1
  5. {corethink-1.0.3 → corethink-1.0.4}/src/corethink.egg-info/PKG-INFO +1 -1
  6. {corethink-1.0.3 → corethink-1.0.4}/tests/test_train.py +22 -0
  7. {corethink-1.0.3 → corethink-1.0.4}/README.md +0 -0
  8. {corethink-1.0.3 → corethink-1.0.4}/setup.cfg +0 -0
  9. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/__init__.py +0 -0
  10. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/__main__.py +0 -0
  11. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/account.py +0 -0
  12. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/cli.py +0 -0
  13. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/client.py +0 -0
  14. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/__init__.py +0 -0
  15. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/admin.py +0 -0
  16. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/api.py +0 -0
  17. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/archive.py +0 -0
  18. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/auth.py +0 -0
  19. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/billing.py +0 -0
  20. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/capture.py +0 -0
  21. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/connection.py +0 -0
  22. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/endpoint.py +0 -0
  23. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/env.py +0 -0
  24. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/hub.py +0 -0
  25. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/library.py +0 -0
  26. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/models.py +0 -0
  27. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/commands/workspace.py +0 -0
  28. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/config.py +0 -0
  29. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/context.py +0 -0
  30. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/env_template.py +0 -0
  31. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/environment_http_store.py +0 -0
  32. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/experiment_cli.py +0 -0
  33. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/hosted_profiles.py +0 -0
  34. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/hosted_rl.py +0 -0
  35. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/hosted_rl_archive.py +0 -0
  36. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/hosted_rl_attribution.py +0 -0
  37. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/hosted_rl_billing.py +0 -0
  38. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/hosted_rl_state.py +0 -0
  39. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/jobs_cli.py +0 -0
  40. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/main.py +0 -0
  41. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/output.py +0 -0
  42. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/py.typed +0 -0
  43. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/rl_cli.py +0 -0
  44. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/rl_inspect.py +0 -0
  45. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/rl_playground.py +0 -0
  46. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/rl_reassessment.py +0 -0
  47. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/rl_settings.py +0 -0
  48. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/sdk.py +0 -0
  49. {corethink-1.0.3 → corethink-1.0.4}/src/corethink/settings.py +0 -0
  50. {corethink-1.0.3 → corethink-1.0.4}/src/corethink.egg-info/SOURCES.txt +0 -0
  51. {corethink-1.0.3 → corethink-1.0.4}/src/corethink.egg-info/dependency_links.txt +0 -0
  52. {corethink-1.0.3 → corethink-1.0.4}/src/corethink.egg-info/entry_points.txt +0 -0
  53. {corethink-1.0.3 → corethink-1.0.4}/src/corethink.egg-info/requires.txt +0 -0
  54. {corethink-1.0.3 → corethink-1.0.4}/src/corethink.egg-info/top_level.txt +0 -0
  55. {corethink-1.0.3 → corethink-1.0.4}/tests/test_admin.py +0 -0
  56. {corethink-1.0.3 → corethink-1.0.4}/tests/test_archive.py +0 -0
  57. {corethink-1.0.3 → corethink-1.0.4}/tests/test_auth.py +0 -0
  58. {corethink-1.0.3 → corethink-1.0.4}/tests/test_billing.py +0 -0
  59. {corethink-1.0.3 → corethink-1.0.4}/tests/test_capture.py +0 -0
  60. {corethink-1.0.3 → corethink-1.0.4}/tests/test_connection.py +0 -0
  61. {corethink-1.0.3 → corethink-1.0.4}/tests/test_endpoint.py +0 -0
  62. {corethink-1.0.3 → corethink-1.0.4}/tests/test_env.py +0 -0
  63. {corethink-1.0.3 → corethink-1.0.4}/tests/test_hub.py +0 -0
  64. {corethink-1.0.3 → corethink-1.0.4}/tests/test_library.py +0 -0
  65. {corethink-1.0.3 → corethink-1.0.4}/tests/test_main_json.py +0 -0
  66. {corethink-1.0.3 → corethink-1.0.4}/tests/test_models.py +0 -0
  67. {corethink-1.0.3 → corethink-1.0.4}/tests/test_version.py +0 -0
  68. {corethink-1.0.3 → corethink-1.0.4}/tests/test_workspace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: corethink
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: The CoreThink Workbench from your terminal: environments, training, endpoints and more.
5
5
  Author-email: CoreThink <support@corethink.ai>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "corethink"
7
- version = "1.0.3"
7
+ version = "1.0.4"
8
8
  description = "The CoreThink Workbench from your terminal: environments, training, endpoints and more."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,3 +1,3 @@
1
1
  """The version of the `corethink` package (read by the build and by `corethink --version`)."""
2
2
 
3
- __version__ = "1.0.3"
3
+ __version__ = "1.0.4"
@@ -1081,6 +1081,8 @@ def estimate_lines(estimate: dict[str, Any] | None, budget: float | None = None)
1081
1081
  text += " The limit is lower; it may stop early."
1082
1082
  elif estimate.get("costUsd") is None and first and (first.get("lowUsd") or 0) > budget:
1083
1083
  text += " The limit is below the low end; it will likely stop early."
1084
+ elif estimate.get("costUsd") is None and first and (first.get("typicalUsd") or 0) > budget:
1085
+ text += " The limit is below the likely cost; it may stop early."
1084
1086
  if estimate.get("waiting"):
1085
1087
  text += f" {plural(estimate['waiting'], 'run')} waiting ahead."
1086
1088
  lines = [text]
@@ -1212,6 +1214,16 @@ def _estimate(plan: Plan) -> dict[str, Any] | None:
1212
1214
  return None
1213
1215
 
1214
1216
 
1217
+ def eval_tasks(plan: Plan) -> int:
1218
+ """Tasks in the final check: at most those held out from training."""
1219
+ usecase = plan.usecase or {}
1220
+ if usecase.get("split"):
1221
+ return int(usecase["split"].get("test") or 0)
1222
+ if usecase.get("scenarios"):
1223
+ return min(plan.check_tasks, withheld_tasks(int(usecase["scenarios"]), plan.share))
1224
+ return plan.check_tasks
1225
+
1226
+
1215
1227
  def _limits_panel(plan: Plan, budget: float, available: float | None, estimate: dict[str, Any] | None) -> None:
1216
1228
  """The console's "Limits for this run" box, on stderr (stdout is for the run itself)."""
1217
1229
  usecase = plan.usecase
@@ -1233,7 +1245,7 @@ def _limits_panel(plan: Plan, budget: float, available: float | None, estimate:
1233
1245
  ("Hyperparameters", "Advanced" if advanced else "Automatic"),
1234
1246
  ("Spending", f"max {ui.usd(budget, 0 if float(budget).is_integer() else 2)}"),
1235
1247
  ("Trains on", trains),
1236
- ("Eval set tasks", str(split.get("test") if split else plan.check_tasks)),
1248
+ ("Eval set tasks", str(eval_tasks(plan))),
1237
1249
  ]
1238
1250
  if plan.method:
1239
1251
  rows.append(("Training method", METHOD_LABEL.get(plan.method, plan.method)))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: corethink
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: The CoreThink Workbench from your terminal: environments, training, endpoints and more.
5
5
  Author-email: CoreThink <support@corethink.ai>
6
6
  License-Expression: MIT
@@ -979,3 +979,25 @@ def test_start_from_an_earlier_run_repeats_its_environment_and_settings(form, ru
979
979
 
980
980
  def test_start_needs_an_environment_or_a_run(form, run):
981
981
  assert run("train", "start", "--yes").code == 2
982
+
983
+
984
+ def test_a_first_runs_limit_below_its_likely_cost_is_flagged():
985
+ from corethink.commands.train import estimate_lines
986
+
987
+ first = {"typicalUsd": 57.3, "lowUsd": 40.1, "highUsd": 85.9, "drivers": [], "assumptions": []}
988
+ estimate = {"costUsd": None, "minutes": None, "firstRun": first}
989
+ assert "may stop early" not in estimate_lines(estimate, 86)[0]
990
+ assert estimate_lines(estimate, 45)[0].endswith("The limit is below the likely cost; it may stop early.")
991
+ assert estimate_lines(estimate, 30)[0].endswith("The limit is below the low end; it will likely stop early.")
992
+
993
+
994
+ def test_the_eval_set_is_at_most_the_tasks_held_out():
995
+ from corethink.commands.train import Plan, eval_tasks
996
+
997
+ made = Plan.__new__(Plan)
998
+ made.usecase, made.share, made.check_tasks = {"scenarios": 80}, 0.6, 40
999
+ assert eval_tasks(made) == 32 # 80 tasks, 48 to train on: 32 held out, not the 40 asked for
1000
+ made.usecase = {"scenarios": 200}
1001
+ assert eval_tasks(made) == 40
1002
+ made.usecase = {"scenarios": 200, "split": {"train": 150, "test": 50}}
1003
+ assert eval_tasks(made) == 50
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes