@dra2020/district-analytics 9.0.1 → 9.0.2

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.
@@ -512,7 +512,8 @@ class Districts {
512
512
  countySplits[outerThis.getCountyIndex(geoID)] += featurePop;
513
513
  }
514
514
  else {
515
- console.log("County not recognized:", geoID);
515
+ if (bLog)
516
+ console.log("County not recognized:", geoID);
516
517
  }
517
518
  // Democratic and Republican vote totals
518
519
  demVotes += outerThis._session.features.fieldForFeature(f, "ELECTION" /* ELECTION */, "D" /* DemVotes */);
@@ -783,7 +784,7 @@ function _getFeatures(f, datasetKey, p) {
783
784
  if (!f.properties['datasets'][datasetKey]) {
784
785
  // Feature is missing the dataset
785
786
  nMissingDataset += 1;
786
- console.log(`${nMissingDataset}: Data ${datasetKey} missing for feature ${f} Returning zero.`);
787
+ // console.log(`${nMissingDataset}: Data ${datasetKey} missing for feature ${f} Returning zero.`);
787
788
  return 0;
788
789
  }
789
790
  return f.properties['datasets'][datasetKey][p];
@@ -815,7 +816,7 @@ function _getFeatures(f, datasetKey, p) {
815
816
  }
816
817
  // Feature is missing the property
817
818
  nMissingProperty += 1;
818
- console.log(`${nMissingProperty}: ${p} value undefined for ${f.properties['GEOID10']}. Returning zero.`);
819
+ // console.log(`${nMissingProperty}: ${p} value undefined for ${f.properties['GEOID10']}. Returning zero.`);
819
820
  return 0;
820
821
  // return undefined;
821
822
  }
@@ -1152,8 +1153,10 @@ function doFindCountiesSplitUnexpectedly(s, bLog = false) {
1152
1153
  // 07-06-20 - Guard in case the FIPS code isn't in the county name lookup
1153
1154
  if (name)
1154
1155
  countiesSplitUnexpectedly.push(name);
1155
- else
1156
- console.log("County is not in the FIPS-to-name lookup table: ", fips);
1156
+ else {
1157
+ if (bLog)
1158
+ console.log("County is not in the FIPS-to-name lookup table: ", fips);
1159
+ }
1157
1160
  }
1158
1161
  countiesSplitUnexpectedly = countiesSplitUnexpectedly.sort();
1159
1162
  test['score'] = U.trim(unexpectedAffected);
@@ -1517,7 +1520,8 @@ function doPreprocessCensus(s, bLog = false) {
1517
1520
  totalByCounty[countyFIPS] += value;
1518
1521
  }
1519
1522
  else {
1520
- console.log("County not recognized:", geoID);
1523
+ if (bLog)
1524
+ console.log("County not recognized:", geoID);
1521
1525
  }
1522
1526
  }
1523
1527
  else {
@@ -2410,11 +2414,13 @@ function doIsComplete(s, bLog = false) {
2410
2414
  // Check the official congressional maps for CT, KY, IL, and MI.
2411
2415
  bAllNonWaterOnlyAssigned = !unassignedFeatures.some(function (geoID) {
2412
2416
  if (U.isWaterOnly(geoID, s)) {
2413
- console.log("Unassigned water-only feature ignored in completeness check: ", geoID);
2417
+ if (bLog)
2418
+ console.log("Unassigned water-only feature ignored in completeness check: ", geoID);
2414
2419
  return false;
2415
2420
  }
2416
2421
  if (U.isUninhabited(geoID, s)) {
2417
- console.log("Uninhabited feature ignored in completeness check: ", geoID);
2422
+ if (bLog)
2423
+ console.log("Uninhabited feature ignored in completeness check: ", geoID);
2418
2424
  return false;
2419
2425
  }
2420
2426
  // Not water-only and inhabited