From c1450bc43086e301b2f0ea5b20eb817973951ce4 Mon Sep 17 00:00:00 2001 From: Dhirendra Singh Date: Wed, 3 Mar 2021 16:03:01 +1100 Subject: [PATCH] Updated expected data files; #4 --- R/checksum.R | 14 +++++++++----- data/.gitignore | 4 +++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/R/checksum.R b/R/checksum.R index 2f357d2..a5714a9 100644 --- a/R/checksum.R +++ b/R/checksum.R @@ -8,6 +8,7 @@ checksum <- function() { '../data/SA1attributed.csv.gz' = '980faffc7c90996510123ce4d69f140e', '../data/SA1centroids.csv.gz' = 'b7f27ff1e176b70cee71723f528f800a', '../data/addresses.csv.gz' = 'ed761018dfdf4e00fdf2054aa25fe3ba', + '../data/vistaCohorts.csv.gz' = 'd9f0c9ad76fc31513afbc9348b747e32', '../data/expectedDistances.rds' = '91e137c02459e21a2fabf541e8cc36de', '../data/vistaSummaries/destinationProbabilitiesSA3.rds' = '7dbacc829b312d608b6f24df7235b028', '../data/vistaSummaries/distanceDistributionsSA3.rds' = '9ded1a901e720c3f670b5ecda6c105f8', @@ -21,12 +22,15 @@ checksum <- function() { for (file in names(expected)) { e <- expected[file] a <- actual[file] - if (a != e) { - cat("MD5 hash of input data file did not match expectation. File may be outdated.\n") - cat(paste0("File: ", file, "\n")) - cat(paste0("Expected hash: ", e, "\n")) - cat(paste0("Actual hash: ", a, "\n")) + cat(paste0("Checking for ", file, ": ")) + if (!file.exists(file)) { + cat("NOT FOUND\n") result <- FALSE + } else if (a != e) { + cat(paste0("MISMATCH\n!!! expected ", e, ", actual ", a, "\n")) + result <- FALSE + } else { + cat("OK\n") } } return(result) diff --git a/data/.gitignore b/data/.gitignore index a4606f0..a9fdcb9 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -1,6 +1,6 @@ distanceMatrix.rds distanceMatrixIndex.csv -expectedDistances.gz +expectedDistances.rds melbourne-2016-population.zip* sa1_2016_aust.csv.gz SA1attributed.csv.gz @@ -8,3 +8,5 @@ SA1centroids.csv.gz addresses.csv.gz vista_2012_16_v1_sa1_csv.zip* VISTA_12_18_CSV.zip* +vistaCohorts.csv.gz +vistaSummaries/