Wire local-only data setup workflow
This commit is contained in:
@@ -4,4 +4,25 @@ set -euo pipefail
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
|
||||
cd "$repo_root"
|
||||
|
||||
Rscript -e 'setwd("data"); source("../src/r/00_data-management.R")'
|
||||
required_model_inputs=(
|
||||
"data/text_data.csv"
|
||||
"data/expert.csv"
|
||||
"data/lr_data.csv"
|
||||
"data/union_mapping.csv"
|
||||
"data/party_families.csv"
|
||||
)
|
||||
|
||||
missing=0
|
||||
for input in "${required_model_inputs[@]}"; do
|
||||
if [ ! -s "$input" ]; then
|
||||
echo "Missing model-ready input: $input" >&2
|
||||
missing=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$missing" -ne 0 ]; then
|
||||
echo "Regenerate model inputs with data-setup/run_data_setup.sh, or restore the included data/ files." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Model-ready data inputs are present."
|
||||
|
||||
Reference in New Issue
Block a user