Download _backup/scripts/run_formula2.sh from TrendeX90/ca-cube: direct link, hf CLI and curl.
- Browser
- Download file 1.82 kB
-
https://huggingface.co/datasets/TrendeX90/ca-cube/resolve/main/_backup/scripts/run_formula2.sh
- Command line
-
hf download hf://datasets/TrendeX90/ca-cube/_backup/scripts/run_formula2.sh
-
curl -L -o run_formula2.sh https://huggingface.co/datasets/TrendeX90/ca-cube/resolve/main/_backup/scripts/run_formula2.sh
1.82 kB
| # Formula re-run with the corrected barren rule (backend main, core_ca.yaml) on the FULL cube (with weather), | |
| # then upload in the order the site needs: fe/ -> layers/ -> cells.parquet + S.npy -> the rest. | |
| set -euo pipefail | |
| cd /root/trendex && git pull -q && git log --oneline -1 | |
| cd backend | |
| export TRENDEX_CONFIG=core_ca.yaml | |
| echo "FORMULA2_BUILD_START $(date -u +%T)" | |
| .venv/bin/python -m pipeline.build --cube /root/trendex-ca/data/cube --out artifacts_ca --clean --jobs 20 | |
| echo "FORMULA2_EXPORT_START $(date -u +%T)" | |
| TRENDEX_ARTIFACTS=artifacts_ca TRENDEX_EXPORT=export_ca/v1 .venv/bin/python scripts/30_export_static.py | |
| TRENDEX_ARTIFACTS=artifacts_ca .venv/bin/python scripts/35_export_frontend.py | |
| du -sh artifacts_ca artifacts_ca/layers export_ca/v1 export/ca/v1/fe || true | |
| python - <<'PY' | |
| from pathlib import Path | |
| from huggingface_hub import HfApi | |
| api, repo, b = HfApi(), "TrendeX90/ca-cube", Path("/root/trendex/backend") | |
| def folder(local, remote, **kw): | |
| api.upload_folder(repo_id=repo, repo_type="dataset", folder_path=str(local), path_in_repo=remote, | |
| commit_message=f"formula v2 (barren rule): {remote}", **kw) | |
| print("pushed", remote, flush=True) | |
| folder(b / "export/ca/v1/fe", "formula/export/ca/v1/fe") | |
| folder(b / "artifacts_ca/layers", "formula/artifacts_ca/layers") | |
| for f in ("cells.parquet", "S.npy"): | |
| api.upload_file(path_or_fileobj=str(b / "artifacts_ca" / f), path_in_repo=f"formula/artifacts_ca/{f}", | |
| repo_id=repo, repo_type="dataset", commit_message=f"formula v2: artifacts_ca/{f}") | |
| print("pushed", f, flush=True) | |
| folder(b / "export_ca/v1", "formula/export_ca/v1") | |
| folder(b / "artifacts_ca", "formula/artifacts_ca", ignore_patterns=["*.npy", "*.npz", "layers/**", "cells.parquet"]) | |
| PY | |
| echo "FORMULA2_DONE $(date -u +%T)" | |