@dra2020/district-analytics 7.1.1 → 7.1.4

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.
package/dist/cli.js CHANGED
@@ -103663,7 +103663,12 @@ function doFindCountiesSplitUnexpectedly(s, bLog = false) {
103663
103663
  }
103664
103664
  // ... and convert the FIPS codes to county names.
103665
103665
  for (let fips of countiesSplitUnexpectedlyFIPS) {
103666
- countiesSplitUnexpectedly.push(s.counties.nameFromFIPS(fips));
103666
+ const name = s.counties.nameFromFIPS(fips);
103667
+ // 07-06-20 - Guard in case the FIPS code isn't in the county name lookup
103668
+ if (name)
103669
+ countiesSplitUnexpectedly.push(name);
103670
+ else
103671
+ console.log("County is not in the FIPS-to-name lookup table: ", fips);
103667
103672
  }
103668
103673
  countiesSplitUnexpectedly = countiesSplitUnexpectedly.sort();
103669
103674
  test['score'] = U.trim(unexpectedAffected);
@@ -104279,9 +104284,9 @@ function doAnalyzePostProcessing(s, bLog = false) {
104279
104284
  scorecard.details['shapes'] = datasets.shapes;
104280
104285
  scorecard.details['census'] = datasets.census;
104281
104286
  const simpleSplits = s.getTest(5 /* UnexpectedCountySplits */);
104282
- scorecard.compactness.details['unexpectedAffected'] = simpleSplits['score'];
104283
- scorecard.compactness.details['nSplits'] = simpleSplits['details']['nSplits'];
104284
- scorecard.compactness.details['countiesSplitUnexpectedly'] = U.deepCopy(simpleSplits['details']['countiesSplitUnexpectedly']);
104287
+ scorecard.splitting.details['unexpectedAffected'] = simpleSplits['score'];
104288
+ scorecard.splitting.details['nSplits'] = simpleSplits['details']['nSplits'];
104289
+ scorecard.splitting.details['countiesSplitUnexpectedly'] = U.deepCopy(simpleSplits['details']['countiesSplitUnexpectedly']);
104285
104290
  // NOTE - Add split precincts in dra-client directly
104286
104291
  // Derive secondary tests
104287
104292
  analyze_1.doDeriveSecondaryTests(s, bLog);