scale-forecasting 1.0.0__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.
- scale_forecasting-1.0.0/.gitignore +68 -0
- scale_forecasting-1.0.0/CHANGELOG.md +52 -0
- scale_forecasting-1.0.0/LICENSE +202 -0
- scale_forecasting-1.0.0/PKG-INFO +361 -0
- scale_forecasting-1.0.0/README.md +207 -0
- scale_forecasting-1.0.0/pyproject.toml +399 -0
- scale_forecasting-1.0.0/src/scale_forecasting/__init__.py +275 -0
- scale_forecasting-1.0.0/src/scale_forecasting/_entry.py +110 -0
- scale_forecasting-1.0.0/src/scale_forecasting/_infra_args.py +91 -0
- scale_forecasting-1.0.0/src/scale_forecasting/agent_surfaces.py +1571 -0
- scale_forecasting-1.0.0/src/scale_forecasting/airflow_emit.py +325 -0
- scale_forecasting-1.0.0/src/scale_forecasting/airflow_tasks.py +414 -0
- scale_forecasting-1.0.0/src/scale_forecasting/automl_submit.py +383 -0
- scale_forecasting-1.0.0/src/scale_forecasting/backtest.py +1153 -0
- scale_forecasting-1.0.0/src/scale_forecasting/batch_infra.py +322 -0
- scale_forecasting-1.0.0/src/scale_forecasting/batch_telemetry.py +241 -0
- scale_forecasting-1.0.0/src/scale_forecasting/calibration.py +900 -0
- scale_forecasting-1.0.0/src/scale_forecasting/capacity.py +659 -0
- scale_forecasting-1.0.0/src/scale_forecasting/cluster_deps.py +113 -0
- scale_forecasting-1.0.0/src/scale_forecasting/cluster_submit.py +383 -0
- scale_forecasting-1.0.0/src/scale_forecasting/cluster_telemetry.py +108 -0
- scale_forecasting-1.0.0/src/scale_forecasting/code_delivery.py +196 -0
- scale_forecasting-1.0.0/src/scale_forecasting/commands.py +459 -0
- scale_forecasting-1.0.0/src/scale_forecasting/compute_fallback.py +190 -0
- scale_forecasting-1.0.0/src/scale_forecasting/config.py +2530 -0
- scale_forecasting-1.0.0/src/scale_forecasting/dag.py +551 -0
- scale_forecasting-1.0.0/src/scale_forecasting/data_gen/__init__.py +3 -0
- scale_forecasting-1.0.0/src/scale_forecasting/data_gen/generator.py +415 -0
- scale_forecasting-1.0.0/src/scale_forecasting/data_gen/seed_spark.py +505 -0
- scale_forecasting-1.0.0/src/scale_forecasting/dataproc_cluster.py +869 -0
- scale_forecasting-1.0.0/src/scale_forecasting/device_audit.py +219 -0
- scale_forecasting-1.0.0/src/scale_forecasting/diagnostics.py +1510 -0
- scale_forecasting-1.0.0/src/scale_forecasting/engines/__init__.py +6 -0
- scale_forecasting-1.0.0/src/scale_forecasting/engines/automl_engine.py +2162 -0
- scale_forecasting-1.0.0/src/scale_forecasting/engines/bigquery_engine.py +623 -0
- scale_forecasting-1.0.0/src/scale_forecasting/engines/bigquery_names.py +101 -0
- scale_forecasting-1.0.0/src/scale_forecasting/engines/bigquery_sql.py +783 -0
- scale_forecasting-1.0.0/src/scale_forecasting/engines/ray_engine.py +809 -0
- scale_forecasting-1.0.0/src/scale_forecasting/engines/ray_io.py +1007 -0
- scale_forecasting-1.0.0/src/scale_forecasting/engines/spark_explode.py +358 -0
- scale_forecasting-1.0.0/src/scale_forecasting/engines/spark_io.py +763 -0
- scale_forecasting-1.0.0/src/scale_forecasting/engines/vertex_engine.py +1171 -0
- scale_forecasting-1.0.0/src/scale_forecasting/ensemble_run.py +1102 -0
- scale_forecasting-1.0.0/src/scale_forecasting/ensembler.py +1279 -0
- scale_forecasting-1.0.0/src/scale_forecasting/errors.py +188 -0
- scale_forecasting-1.0.0/src/scale_forecasting/features.py +1352 -0
- scale_forecasting-1.0.0/src/scale_forecasting/gce_submit.py +1028 -0
- scale_forecasting-1.0.0/src/scale_forecasting/gke_submit.py +1587 -0
- scale_forecasting-1.0.0/src/scale_forecasting/hardware.py +265 -0
- scale_forecasting-1.0.0/src/scale_forecasting/hpo.py +424 -0
- scale_forecasting-1.0.0/src/scale_forecasting/identity.py +94 -0
- scale_forecasting-1.0.0/src/scale_forecasting/job_launch.py +768 -0
- scale_forecasting-1.0.0/src/scale_forecasting/job_outcome.py +241 -0
- scale_forecasting-1.0.0/src/scale_forecasting/job_wait.py +111 -0
- scale_forecasting-1.0.0/src/scale_forecasting/launch_plan.py +1107 -0
- scale_forecasting-1.0.0/src/scale_forecasting/main.py +799 -0
- scale_forecasting-1.0.0/src/scale_forecasting/mcp.py +1385 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/__init__.py +253 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/_intervals.py +19 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/base_metric.py +217 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/bias.py +34 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/coverage.py +40 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/cv.py +24 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/interval_score.py +42 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/interval_width.py +38 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/maape.py +38 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/mae.py +30 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/mape.py +33 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/mase.py +45 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/mase_seasonal.py +49 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/mse.py +32 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/msis.py +30 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/msse.py +28 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/ope.py +24 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/pinball.py +49 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/r2.py +27 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/rmse.py +30 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/rmsle.py +25 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/rmsse.py +41 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/smape.py +33 -0
- scale_forecasting-1.0.0/src/scale_forecasting/metrics/wape.py +34 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/__init__.py +112 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/_lag_forecaster.py +407 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/_neuralforecast_base.py +605 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/_vertex_automl_base.py +268 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/auto_arima.py +142 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/auto_ces.py +103 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/auto_theta.py +113 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/autoets.py +106 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/base_model.py +600 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/bigquery_native.py +177 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/catboost_model.py +159 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/croston.py +137 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/fft.py +108 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/holtwinters.py +85 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/kalman.py +95 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/lightgbm_model.py +160 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/naive_drift.py +69 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/naive_mean.py +60 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/naive_moving_average.py +93 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/naive_seasonal.py +72 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/neuralprophet_model.py +421 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/patchtst.py +51 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/prophet_model.py +121 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/random_forest.py +153 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/regression_lags.py +171 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/sarimax.py +92 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/stl_bagging.py +109 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/tbats_model.py +102 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/tft.py +46 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/theta.py +89 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/tide.py +47 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/tsmixer.py +48 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/ucm.py +91 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/vertex_l2l.py +31 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/vertex_seq2seq.py +30 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/vertex_tft.py +32 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/vertex_tide.py +32 -0
- scale_forecasting-1.0.0/src/scale_forecasting/models/xgboost_model.py +164 -0
- scale_forecasting-1.0.0/src/scale_forecasting/notebook_acceptance.py +755 -0
- scale_forecasting-1.0.0/src/scale_forecasting/playground.py +793 -0
- scale_forecasting-1.0.0/src/scale_forecasting/probes/__init__.py +3 -0
- scale_forecasting-1.0.0/src/scale_forecasting/probes/cancel.py +408 -0
- scale_forecasting-1.0.0/src/scale_forecasting/probes/reconcile.py +577 -0
- scale_forecasting-1.0.0/src/scale_forecasting/probes/runtimes.py +941 -0
- scale_forecasting-1.0.0/src/scale_forecasting/probes/settle.py +466 -0
- scale_forecasting-1.0.0/src/scale_forecasting/probes/vocabulary.py +245 -0
- scale_forecasting-1.0.0/src/scale_forecasting/profiling/__init__.py +3 -0
- scale_forecasting-1.0.0/src/scale_forecasting/profiling/baseline.py +240 -0
- scale_forecasting-1.0.0/src/scale_forecasting/profiling/cost.py +705 -0
- scale_forecasting-1.0.0/src/scale_forecasting/profiling/measure.py +440 -0
- scale_forecasting-1.0.0/src/scale_forecasting/profiling/numeric.py +73 -0
- scale_forecasting-1.0.0/src/scale_forecasting/profiling/sampling.py +290 -0
- scale_forecasting-1.0.0/src/scale_forecasting/profiling/signature.py +136 -0
- scale_forecasting-1.0.0/src/scale_forecasting/profiling/source.py +473 -0
- scale_forecasting-1.0.0/src/scale_forecasting/profiling/stats.py +221 -0
- scale_forecasting-1.0.0/src/scale_forecasting/py.typed +0 -0
- scale_forecasting-1.0.0/src/scale_forecasting/quota.py +1767 -0
- scale_forecasting-1.0.0/src/scale_forecasting/ray_cluster.py +767 -0
- scale_forecasting-1.0.0/src/scale_forecasting/ray_entry.py +46 -0
- scale_forecasting-1.0.0/src/scale_forecasting/ray_infra.py +121 -0
- scale_forecasting-1.0.0/src/scale_forecasting/ray_jobs.py +462 -0
- scale_forecasting-1.0.0/src/scale_forecasting/ray_reaper.py +392 -0
- scale_forecasting-1.0.0/src/scale_forecasting/ray_submit.py +323 -0
- scale_forecasting-1.0.0/src/scale_forecasting/ray_telemetry.py +106 -0
- scale_forecasting-1.0.0/src/scale_forecasting/reconciliation.py +929 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/__init__.py +3 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/artifacts.py +223 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/cells.py +115 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/ddl.py +408 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/harvest.py +252 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/header.py +368 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/ids.py +556 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/jobs.py +191 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/lifecycle.py +284 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/ops.py +1666 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/params.py +150 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/reads.py +971 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/rows.py +556 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/tables.py +150 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/views.py +399 -0
- scale_forecasting-1.0.0/src/scale_forecasting/registry/write_api.py +386 -0
- scale_forecasting-1.0.0/src/scale_forecasting/report.py +932 -0
- scale_forecasting-1.0.0/src/scale_forecasting/resources/__init__.py +3 -0
- scale_forecasting-1.0.0/src/scale_forecasting/resources/audit.py +64 -0
- scale_forecasting-1.0.0/src/scale_forecasting/resources/catalog.py +263 -0
- scale_forecasting-1.0.0/src/scale_forecasting/resources/cluster.py +352 -0
- scale_forecasting-1.0.0/src/scale_forecasting/resources/fleet.py +613 -0
- scale_forecasting-1.0.0/src/scale_forecasting/resources/serverless.py +428 -0
- scale_forecasting-1.0.0/src/scale_forecasting/resources/slot.py +295 -0
- scale_forecasting-1.0.0/src/scale_forecasting/retry_policy.py +378 -0
- scale_forecasting-1.0.0/src/scale_forecasting/retry_run.py +535 -0
- scale_forecasting-1.0.0/src/scale_forecasting/review.py +2689 -0
- scale_forecasting-1.0.0/src/scale_forecasting/router.py +41 -0
- scale_forecasting-1.0.0/src/scale_forecasting/scenarios.py +564 -0
- scale_forecasting-1.0.0/src/scale_forecasting/sdk.py +2073 -0
- scale_forecasting-1.0.0/src/scale_forecasting/seasonality.py +60 -0
- scale_forecasting-1.0.0/src/scale_forecasting/settings.py +171 -0
- scale_forecasting-1.0.0/src/scale_forecasting/shared_clusters.py +348 -0
- scale_forecasting-1.0.0/src/scale_forecasting/smoke_run.py +83 -0
- scale_forecasting-1.0.0/src/scale_forecasting/spark_entry.py +47 -0
- scale_forecasting-1.0.0/src/scale_forecasting/staging.py +121 -0
- scale_forecasting-1.0.0/src/scale_forecasting/submit.py +667 -0
- scale_forecasting-1.0.0/src/scale_forecasting/submitters.py +515 -0
- scale_forecasting-1.0.0/src/scale_forecasting/validation.py +201 -0
- scale_forecasting-1.0.0/src/scale_forecasting/vertex_entry.py +81 -0
- scale_forecasting-1.0.0/src/scale_forecasting/vertex_submit.py +680 -0
- scale_forecasting-1.0.0/src/scale_forecasting/worker.py +1432 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
|
|
9
|
+
# Virtual envs (.venv-ci is the second env `make ci-offline` syncs exactly like the CI offline job)
|
|
10
|
+
.venv/
|
|
11
|
+
.venv-ci/
|
|
12
|
+
venv/
|
|
13
|
+
|
|
14
|
+
# uv
|
|
15
|
+
# (uv.lock IS committed — it pins the reproducible env)
|
|
16
|
+
|
|
17
|
+
# Artifacts / caches
|
|
18
|
+
*.pkl
|
|
19
|
+
*.parquet
|
|
20
|
+
.pytest_cache/
|
|
21
|
+
.ruff_cache/
|
|
22
|
+
.mypy_cache/
|
|
23
|
+
htmlcov/
|
|
24
|
+
.coverage
|
|
25
|
+
.coverage.*
|
|
26
|
+
|
|
27
|
+
# Documentation site build output (published by CI, never committed)
|
|
28
|
+
site/
|
|
29
|
+
.cache/
|
|
30
|
+
|
|
31
|
+
# Credentials / local config — never commit
|
|
32
|
+
.env
|
|
33
|
+
*.json.key
|
|
34
|
+
service-account*.json
|
|
35
|
+
application_default_credentials.json
|
|
36
|
+
|
|
37
|
+
# Terraform local state (remote GCS backend is authoritative)
|
|
38
|
+
*.tfstate
|
|
39
|
+
*.tfstate.*
|
|
40
|
+
.terraform/
|
|
41
|
+
.terraform-tmp/
|
|
42
|
+
.terraform.lock.hcl
|
|
43
|
+
# Never commit real ids (billing/org) or generated plans
|
|
44
|
+
terraform.tfvars
|
|
45
|
+
*.auto.tfvars
|
|
46
|
+
*.tfplan
|
|
47
|
+
|
|
48
|
+
# Throwaway spikes — live-infra experiments, never product surface
|
|
49
|
+
spikes/
|
|
50
|
+
|
|
51
|
+
# Notebooks
|
|
52
|
+
.ipynb_checkpoints/
|
|
53
|
+
|
|
54
|
+
# NeuralProphet / PyTorch-Lightning training artifacts (written to CWD on fit)
|
|
55
|
+
lightning_logs/
|
|
56
|
+
# Lightning's learning-rate finder drops a uuid-named checkpoint beside the process, not under
|
|
57
|
+
# lightning_logs/, so the directory rule above never catches it.
|
|
58
|
+
.lr_find_*.ckpt
|
|
59
|
+
|
|
60
|
+
# Local-only working files — never tracked (AGENTS.md at repo root is tracked).
|
|
61
|
+
.claude/
|
|
62
|
+
CLAUDE.md
|
|
63
|
+
NOTES.md
|
|
64
|
+
|
|
65
|
+
# OS / editor
|
|
66
|
+
.DS_Store
|
|
67
|
+
.idea/
|
|
68
|
+
.vscode/
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `scale-forecasting` are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [Unreleased]
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## [1.0.0] - 2026-10-12
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **Declarative Execution Contract (`RunConfig`):** One JSON/dict contract ([`src/scale_forecasting/config.py`](./src/scale_forecasting/config.py)) drives execution across Local CLI, Python SDK (`Forecaster`), Interactive Notebooks, Cloud Composer 3 DAGs (`--emit-airflow`), and Headless Cloud Batch containers, with deterministic content-addressed `run_id` and per-model `model_spec_hash` hashing ([`src/scale_forecasting/registry/ids.py`](./src/scale_forecasting/registry/ids.py)).
|
|
19
|
+
- **34 Forecasting Models Across 5 Families + Multi-Instance `<base_model>@<tag>` Variants:**
|
|
20
|
+
- `statistical` (`18`): `theta`, `auto_theta`, `holtwinters`, `autoets`, `auto_arima`, `sarimax`, `tbats`, `auto_ces`, `stl_bagging`, `ucm`, `kalman`, `prophet`, `croston` (`classic`, `sba`, `tsb`), `fft`, `naive_mean`, `naive_seasonal`, `naive_drift`, `naive_moving_average`.
|
|
21
|
+
- `ml` (`5`): `lightgbm`, `xgboost`, `catboost`, `random_forest`, `regression_lags` with both `"recursive"` and `"direct"` multi-step horizon strategies and customizable target `lags`.
|
|
22
|
+
- `deep_learning` (`5`): `tide`, `tft`, `tsmixer`, `patchtst`, `neuralprophet` across `local`, `global`, and `hybrid` panel regimes.
|
|
23
|
+
- `automl` (`4`): `vertex_l2l`, `vertex_tide`, `vertex_tft`, `vertex_seq2seq` via Vertex AI Tabular Workflows and managed AutoML training jobs.
|
|
24
|
+
- `native` (`2`): `arima_plus` and `timesfm` (`AI.FORECAST`) executed natively in BigQuery SQL with SQL-enforced `output` bounds and integer rounding.
|
|
25
|
+
- **21 Evaluation Metrics & Conformal Calibration:** 16 point metrics (`wape`, `smape`, `mape`, `maape`, `ope`, `mae`, `rmse`, `mse`, `rmsle`, `bias`, `mase`, `mase_seasonal`, `rmsse`, `msse`, `r2`, `cv`) and 5 interval metrics (`coverage`, `pinball`, `interval_score`, `interval_width`, `msis`), plus empirical conformal residual calibration ([`src/scale_forecasting/calibration.py`](./src/scale_forecasting/calibration.py)).
|
|
26
|
+
- **7 Google Cloud Compute Runtimes & Per-Family DAG Router:** Parallel per-family job dispatch ([`src/scale_forecasting/dag.py`](./src/scale_forecasting/dag.py)) across Dataproc Serverless / Cluster / Connect (`spark`), Ray on Vertex AI or GKE (`ray`), Vertex AI CustomJob (`vertex`), self-deleting Compute Engine Single-VM (`gce`), GKE Indexed Job (`gke`), Vertex AI AutoML (`vertex_automl`), and BigQuery ML (`bigquery`), supporting CPU and NVIDIA `T4`, `L4`, `A100`, and `A100_80GB` GPUs with BigQuery Storage Read API `[start_id, end_id]` worker sharding and LPT chunk scheduling.
|
|
27
|
+
- **Hierarchical Reconciliation, Smart Ensembles & Two-Tier Explainability:** All 8 Hyndman FPP3 reconciliation methods (`mint_shrink`, `mint_nonneg` active-set non-negative QP, `wls_var`, `wls_struct`, `ols`, `bottom_up`, `top_down`, `middle_out`), 9 ensemble strategies (`mean`, `median`, `trimmed_mean`, `inverse_error`, `champion`, `horizon_specialist`, `nnls`, `ridge`, `xgb`) with `top_k`, `parsimony_margin`, and `variant_policy` (`"all"`, `"best_per_base_model"`, `"primary_only"`), calibrated ensemble prediction intervals, cross-run ensembling (`ensemble_cross_runs`), and two-tier feature attributions (`feature_attributions()` and `explain()`).
|
|
28
|
+
- **Forecaster Decision Workbench (`Phases G.1–G.5`):**
|
|
29
|
+
- **Physical Bounds & Quantile/Newsvendor Targets (`output`):** Scalar and per-series bounds (`floor`, `cap`, `floor_col`, `cap_col`), integer rounding (`"none"`, `"round"`, `"ceil"`, `"floor"`, `"cumulative_round"`), monotone multi-percentile fans (`output.quantiles`), and Newsvendor asymmetric cost optimization (`underage_cost`, `overage_cost`, `target_quantile`).
|
|
30
|
+
- **Pre-Fit Data Hygiene & SBC Regime Routing (`data`, `features`):** Grid regularization (`grid_policy`), `trim_leading_zeros`, X-13 `trading_days`, fold-safe outlier despiking (`outlier_policy` / `outlier_handling`), censored stockout recovery (`censored_col`), and Syntetos–Boylan–Croston demand classification (`compute_demand_profile`) with optional `regime_routing`.
|
|
31
|
+
- **Econometric Diagnostics, Scenarios, Lifecycle Governance & HTML Reports (`diagnostics.py`, `scenarios.py`, `report.py`):** Multi-baseline Forecast Value Added (`compute_fva` with Total, Covariate, Drop-One, and Pooling FVA + Harvey–Leybourne–Newbold modified Diebold–Mariano & Wilcoxon $p$-values), horizon decay (`compute_horizon_decay`), directional bias & Trigg Tracking Signal audits (`compute_bias_report`), AR(1) autocorrelation-aware temporal rollups (`rollup_time`), date-scoped promo/price scenario simulation with revenue impact (`simulate_scenarios`), realized accuracy vs. new actuals (`compute_realized_accuracy`), cross-run revision stability (`compute_revision_stability`), Top-$N$ exception triage queues (`compute_exceptions_queue`), and single-file interactive HTML/JSON executive reports (`export_report`).
|
|
32
|
+
- **Ablation Ladders & Snapshot-Verified Cross-Run Cell Borrowing (`reuse_prior_runs`):** Declarative `ablation_modes` (`cov_ladder`, `cov_by_tier`, `cov_by_column`, `cov_drop_one`, `scope_ladder`, `transform_ladder`) and server-side BigQuery cell borrowing (`ops.find_reusable_models`, `ops.borrow_model_results`) that skips cloud compute for invariant models.
|
|
33
|
+
- **BigQuery Registry & Analytical SQL Views:** 4 source tables, 5 registry tables (`run_registry`, `run_jobs`, `forecast_metadata`, `forecast_predictions`, `backtest_oof`), and 5 analytical SQL views (`v_model_leaderboard`, `v_model_leaderboard_comparable`, `v_backtest_coverage`, `v_run_summary` with per-job time ledger, and `v_run_jobs`), plus surgical per-cell repair ([`src/scale_forecasting/retry_run.py`](./src/scale_forecasting/retry_run.py)) and `Registry.doctor()`.
|
|
34
|
+
- **Two-Stage Terraform Infrastructure, 11 Notebooks & 42 Live Smoke Configs:** Complete bootstrap + main Terraform modules ([`terraform/`](./terraform/README.md)), 11 interactive notebooks across 4 learning tracks ([`notebooks/`](./notebooks/README.md)), and 42 live-validated smoke configurations + 4 full-breadth multi-runtime verification runs recorded in [`docs/validation.md`](./docs/validation.md).
|
|
35
|
+
- **Agent-First Surfaces (`SKILL.md`, Built-in `stdio` MCP Server, JSON Schema, `llms.txt` & Cloud Shell Tutorial):** Portable Agent Skill ([`skills/scale-forecasting/SKILL.md`](./skills/scale-forecasting/SKILL.md)) with workspace auto-discovery ([`.agents/skills.json`](./.agents/skills.json) and `.agents/skills/scale-forecasting`), zero-extra JSON-RPC 2.0 MCP server ([`src/scale_forecasting/mcp.py`](./src/scale_forecasting/mcp.py)) exposing 7 `forecast://*` resources and 9 tools with `--allow-launch` safety gating, published `RunConfig` JSON Schema ([`docs/schemas/run_config.schema.json`](./docs/schemas/run_config.schema.json)), `llms.txt` / `llms-full.txt`, Google Antigravity [`plugin.json`](./plugin.json) + [`mcp_config.json`](./mcp_config.json), portable [`.mcp.json`](./.mcp.json), [`cloudshell_tutorial.md`](./cloudshell_tutorial.md), and pre-commit zero-drift synthesis ([`src/scale_forecasting/agent_surfaces.py`](./src/scale_forecasting/agent_surfaces.py)).
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- **Modular Dependency Extras (`pyproject.toml`):** Core `pip install scale-forecasting` installs only the pure offline forecasting layer with zero Google Cloud clients. All Google Cloud SDKs live in `[gcp]`, with composable `[notebook]`, `[spark]`, `[ray]`, `[submit]`, `[models-stats]`, `[models-trees]`, `[models-prophet]`, `[models-dl]`, `[models-automl]`, `[models]`, and `[all]` extras and actionable `MissingExtraError` guidance at every cloud and plotting entry point.
|
|
40
|
+
- **Static Typing, Logging & Test Ratchet:** Added PEP 561 `py.typed` marker with zero `mypy` errors across all 181 source modules, library-safe `NullHandler` logging (`configure_cli_logging` on CLI entry points), widened Ruff lint families (`SIM`, `C4`, `PIE`, `PERF`, `RUF`, `BLE`), and enforced an 85 % offline line-coverage ratchet in CI (`4,960` offline unit tests).
|
|
41
|
+
- **Python 3.11–3.12 Package Support:** `requires-python` widened from `>=3.11,<3.12` to `>=3.11,<3.13` with `3.12` classifiers and a per-interpreter CI `core-install` matrix; the cloud stack stays pinned to `3.11.15` (`.python-version`) for Spark Connect and Ray on Vertex pickle parity ([`docs/version_matrix.md`](./docs/version_matrix.md)). 3.13 waits on the `numpy<2` pin `neuralprophet` still needs.
|
|
42
|
+
- **Per-Job Provisioning vs. Execution Telemetry:** `run_jobs.job_telemetry.$.platform` (`provision_s`, `execute_s`, `total_wall_s`) is stamped from one probe read of each finished Dataproc Serverless batch or Vertex `CustomJob` (`batch_telemetry.platform_phases`), and `v_run_jobs` projects it as `provision_seconds` / `execute_seconds` beside `runtime_seconds`; the Serverless header telemetry carries the same split.
|
|
43
|
+
- **One BigQuery Client Factory:** Every `bigquery.Client(...)` in the package (73 sites) now goes through `registry.tables.bigquery_client`, which guards on `google.cloud.bigquery` alone via the new `errors.require_modules` so an on-cluster worker that never holds the launch clients still reaches the registry, and a core-only install gets the `[gcp]` install line instead of a `ModuleNotFoundError`.
|
|
44
|
+
- **`DataConfig` Identifier Validation:** `source_table` must be `table`, `dataset.table`, or `project.dataset.table` with no backticks, whitespace, or control characters, and `ts_id_col` / `date_col` / `target_col` must be BigQuery column names — checked once at config load, where the values are interpolated into backticked SQL. No field is added, so no `run_id` moves.
|
|
45
|
+
|
|
46
|
+
### Security
|
|
47
|
+
|
|
48
|
+
- **HTML Report Hardening (`report.py`):** The inline `EXPLORER_DATA` JSON escapes `<`, `>`, and `&` as `\u003c` / `\u003e` / `\u0026` so a series id containing `</script>` cannot close the script block, and the fan-chart label is HTML-escaped (`escHtml`) before `innerHTML` assignment.
|
|
49
|
+
- **FIPS-Safe Content Addressing:** `code_delivery` tags staged code archives with `hashlib.md5(..., usedforsecurity=False)` (a content-address, not a digest), so staging works on FIPS-enforced hosts.
|
|
50
|
+
|
|
51
|
+
[Unreleased]: https://github.com/statmike/scale-forecasting/compare/v1.0.0...HEAD
|
|
52
|
+
[1.0.0]: https://github.com/statmike/scale-forecasting/releases/tag/v1.0.0
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|