@dra2020/district-analytics 8.2.6 → 8.2.7

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.
@@ -1317,8 +1317,12 @@ function doHasEqualPopulations(s, bLog = false) {
1317
1317
  let popDevTest = s.getTest(4 /* PopulationDeviation */);
1318
1318
  const popDevPct = popDevTest['score'];
1319
1319
  const popDevNormalized = popDevTest['normalizedScore'];
1320
+ // 09-19-2020 - Added to catch edge case of only one non-empty district
1321
+ const p = s._profile;
1322
+ const totPopByDistrict = p.populationProfile.totalPopByDistrict.filter(x => x > 0);
1323
+ const bTwoOrMoreDistricts = (totPopByDistrict.length > 1) ? true : false;
1320
1324
  // Populate the test entry
1321
- if (popDevNormalized > 0) {
1325
+ if (bTwoOrMoreDistricts && (popDevNormalized > 0)) {
1322
1326
  test['score'] = true;
1323
1327
  }
1324
1328
  else {