Wire local-only data setup workflow
This commit is contained in:
+14
-7
@@ -17,27 +17,33 @@ export PARTY2D_RAW_DATA_DIR="${PARTY2D_RAW_DATA_DIR:-$repo_root/_local/raw}"
|
||||
export TMPDIR="${TMPDIR:-$repo_root/_local/tmp}"
|
||||
mkdir -p "$TMPDIR"
|
||||
|
||||
required_model_inputs=(
|
||||
"data/text_data.csv"
|
||||
"data/expert.csv"
|
||||
"data/lr_data.csv"
|
||||
"data/union_mapping.csv"
|
||||
"data/party_families.csv"
|
||||
)
|
||||
|
||||
if [ "$MODE" = "dry-run" ]; then
|
||||
echo "Checking commands..."
|
||||
command -v bash >/dev/null
|
||||
command -v Rscript >/dev/null
|
||||
command -v julia >/dev/null
|
||||
echo "Checking key files..."
|
||||
test -f Project.toml
|
||||
test -f Manifest.toml
|
||||
test -f models/stan_model_2dim_v6.stan
|
||||
test -f data/text_data.csv
|
||||
test -f data/expert.csv
|
||||
test -f data/lr_data.csv
|
||||
test -f data/model_data.csv
|
||||
for input in "${required_model_inputs[@]}"; do
|
||||
test -f "$input"
|
||||
done
|
||||
echo "Checking shell syntax..."
|
||||
bash -n scripts/01_prepare_data.sh
|
||||
bash -n scripts/02_fit_model.sh
|
||||
bash -n scripts/03_extract_estimates.sh
|
||||
bash -n scripts/04_enrich_estimates.sh
|
||||
bash -n scripts/05_validate_estimates.sh
|
||||
echo "Checking R syntax..."
|
||||
Rscript -e 'files <- list.files("src/r", pattern="\\.R$", full.names=TRUE); invisible(lapply(files, parse))'
|
||||
bash -n data-setup/run_data_setup.sh
|
||||
bash -n data-setup/check_raw_data.sh
|
||||
echo "Checking Julia project can instantiate without running model code..."
|
||||
julia --project=. -e 'import Pkg; Pkg.instantiate(); println("Julia project OK")'
|
||||
echo "Dry run passed. No model fitting was run."
|
||||
@@ -54,3 +60,4 @@ fi
|
||||
|
||||
bash scripts/03_extract_estimates.sh
|
||||
bash scripts/04_enrich_estimates.sh
|
||||
bash scripts/05_validate_estimates.sh
|
||||
|
||||
Reference in New Issue
Block a user