From 03d3af1ea0f1566bf360c268b12b0d19662f5646 Mon Sep 17 00:00:00 2001 From: Vishal Gupta Date: Mon, 9 Dec 2024 06:39:53 +0000 Subject: [PATCH] Add min/max value stats to summary report --- .../output/summary_report.html | 12 ++++-- .../output/summary_report.html | 6 ++- .../output/summary_report.html | 6 ++- .../output/summary_report.html | 10 ++++- .../resolution/output/summary_report.html | 16 +++++--- .../statchecks/output/summary_report.html | 38 ++++++++++--------- .../allfiletypes/output/summary_report.html | 30 +++++++++------ .../statchecks/output/summary_report.html | 16 +++++--- .../org/datacommons/util/CSVReportWriter.java | 8 +++- .../org/datacommons/util/StatChecker.java | 7 ++++ .../util/SummaryReportGenerator.java | 14 ++++++- util/src/main/resources/SummaryReport.ftl | 4 ++ .../datacommons/util/CSVReportWriterTest.java | 11 ++++-- 13 files changed, 124 insertions(+), 54 deletions(-) diff --git a/tool/src/test/resources/org/datacommons/tool/genmcf/latlngresolution/output/summary_report.html b/tool/src/test/resources/org/datacommons/tool/genmcf/latlngresolution/output/summary_report.html index 70f6d930..857b64ed 100644 --- a/tool/src/test/resources/org/datacommons/tool/genmcf/latlngresolution/output/summary_report.html +++ b/tool/src/test/resources/org/datacommons/tool/genmcf/latlngresolution/output/summary_report.html @@ -294,6 +294,8 @@

StatVar Num Places Num Observations + Min Value + Max Value Num Observation Dates Min Date Max Date @@ -309,6 +311,8 @@

4 4 1 + 5 + 1 2019 2019 @@ -371,7 +375,7 @@

-2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 +2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 @@ -415,7 +419,7 @@

-2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 +2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 @@ -459,7 +463,7 @@

-2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 +2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 @@ -503,7 +507,7 @@

-2018-12-312019-01-014.04.24.44.64.85.05.25.45.65.86.0 +2018-12-312019-01-014.04.24.44.64.85.05.25.45.65.86.0 diff --git a/tool/src/test/resources/org/datacommons/tool/genmcf/localidresolution/output/summary_report.html b/tool/src/test/resources/org/datacommons/tool/genmcf/localidresolution/output/summary_report.html index f9ddd06b..aeea8ea9 100644 --- a/tool/src/test/resources/org/datacommons/tool/genmcf/localidresolution/output/summary_report.html +++ b/tool/src/test/resources/org/datacommons/tool/genmcf/localidresolution/output/summary_report.html @@ -249,6 +249,8 @@

StatVar Num Places Num Observations + Min Value + Max Value Num Observation Dates Min Date Max Date @@ -264,6 +266,8 @@

1 1 1 + 1 + 1 2020-01-01 2020-01-01 @@ -326,7 +330,7 @@

-2019-12-312020-01-010.00.20.40.60.81.01.21.41.61.82.0 +2019-12-312020-01-010.00.20.40.60.81.01.21.41.61.82.0 diff --git a/tool/src/test/resources/org/datacommons/tool/genmcf/manyinconsistent/output/summary_report.html b/tool/src/test/resources/org/datacommons/tool/genmcf/manyinconsistent/output/summary_report.html index 69ef972a..0c4a8eb9 100644 --- a/tool/src/test/resources/org/datacommons/tool/genmcf/manyinconsistent/output/summary_report.html +++ b/tool/src/test/resources/org/datacommons/tool/genmcf/manyinconsistent/output/summary_report.html @@ -258,6 +258,8 @@

StatVar Num Places Num Observations + Min Value + Max Value Num Observation Dates Min Date Max Date @@ -273,6 +275,8 @@

1 3 1 + 3 + 1 2020-01-01 2020-01-01 @@ -335,7 +339,7 @@

-2019-12-312020-01-010.00.20.40.60.81.01.21.41.61.82.0 +2019-12-312020-01-010.00.20.40.60.81.01.21.41.61.82.0 diff --git a/tool/src/test/resources/org/datacommons/tool/genmcf/measurementresult/output/summary_report.html b/tool/src/test/resources/org/datacommons/tool/genmcf/measurementresult/output/summary_report.html index 3aa7a896..f824d894 100644 --- a/tool/src/test/resources/org/datacommons/tool/genmcf/measurementresult/output/summary_report.html +++ b/tool/src/test/resources/org/datacommons/tool/genmcf/measurementresult/output/summary_report.html @@ -277,6 +277,8 @@

StatVar Num Places Num Observations + Min Value + Max Value Num Observation Dates Min Date Max Date @@ -291,6 +293,8 @@

Acre_MeasurementResult_StatVar 1 5 + 179,769,313,486,231,570,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 + 0 5 2020-01-01 2020-01-05 @@ -311,6 +315,8 @@

StatVar_DoesNotExistAnywhere 1 5 + 179,769,313,486,231,570,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 + 0 5 2020-01-01 2020-01-05 @@ -331,6 +337,8 @@

WHO/TOBACCO_0000000342 1 5 + 42 + 42 5 2020-01-01 2020-01-05 @@ -432,7 +440,7 @@

-2020-01-042020-01-0541.041.241.441.641.842.042.242.442.642.843.0 +2020-01-042020-01-0541.041.241.441.641.842.042.242.442.642.843.0 diff --git a/tool/src/test/resources/org/datacommons/tool/genmcf/resolution/output/summary_report.html b/tool/src/test/resources/org/datacommons/tool/genmcf/resolution/output/summary_report.html index f23f7145..3e9c3381 100644 --- a/tool/src/test/resources/org/datacommons/tool/genmcf/resolution/output/summary_report.html +++ b/tool/src/test/resources/org/datacommons/tool/genmcf/resolution/output/summary_report.html @@ -365,6 +365,8 @@

StatVar Num Places Num Observations + Min Value + Max Value Num Observation Dates Min Date Max Date @@ -379,6 +381,8 @@

Count_Person 1 1 + 1,000 + 1,000 1 2017-01 2017-01 @@ -399,6 +403,8 @@

CumulativeCount_MedicalTest_ConditionCOVID_19_Positive_Super_Super_Super_Super_Super_Long_Variable_Name 4 10 + 1 + 3 5 2020-01-30 2020-03-03 @@ -462,7 +468,7 @@

-2016-12-312017-01-01999.0999.2999.4999.6999.81000.01000.21000.41000.61000.81001.0 +2016-12-312017-01-01999.0999.2999.4999.6999.81000.01000.21000.41000.61000.81001.0 @@ -506,7 +512,7 @@

-30-Jan14-Feb29-Feb1.01.21.41.61.82.02.22.42.62.83.0 +30-Jan14-Feb29-Feb1.01.21.41.61.82.02.22.42.62.83.0 @@ -550,7 +556,7 @@

-00:0006:0012:0018:0000:000.00.20.40.60.81.01.21.41.61.82.0 +00:0006:0012:0018:0000:000.00.20.40.60.81.01.21.41.61.82.0 @@ -594,7 +600,7 @@

-2020-03-022020-03-030.00.20.40.60.81.01.21.41.61.82.0 +2020-03-022020-03-030.00.20.40.60.81.01.21.41.61.82.0 @@ -638,7 +644,7 @@

-00:0006:0012:0018:0000:000.00.20.40.60.81.01.21.41.61.82.0 +00:0006:0012:0018:0000:000.00.20.40.60.81.01.21.41.61.82.0 diff --git a/tool/src/test/resources/org/datacommons/tool/genmcf/statchecks/output/summary_report.html b/tool/src/test/resources/org/datacommons/tool/genmcf/statchecks/output/summary_report.html index 9967918c..682321ae 100644 --- a/tool/src/test/resources/org/datacommons/tool/genmcf/statchecks/output/summary_report.html +++ b/tool/src/test/resources/org/datacommons/tool/genmcf/statchecks/output/summary_report.html @@ -440,6 +440,8 @@

StatVar Num Places Num Observations + Min Value + Max Value Num Observation Dates Min Date Max Date @@ -454,6 +456,8 @@

CumulativeCount_MedicalTest_ConditionCOVID_19_Positive 17 55 + 0 + 275 16 2020-01-02 2022-06-02 @@ -519,7 +523,7 @@

-00:0006:0012:0018:0000:001.01.11.21.31.41.51.61.71.81.92.0 +00:0006:0012:0018:0000:001.01.11.21.31.41.51.61.71.81.92.0 CumulativeCount_MedicalTest_ConditionCOVID_19_Positive @@ -542,7 +546,7 @@

-00:0006:0012:0018:0000:001.01.11.21.31.41.51.61.71.81.92.0 +00:0006:0012:0018:0000:001.01.11.21.31.41.51.61.71.81.92.0 CumulativeCount_MedicalTest_ConditionCOVID_19_Positive @@ -565,7 +569,7 @@

-00:0006:0012:0018:0000:001.01.11.21.31.41.51.61.71.81.92.0 +00:0006:0012:0018:0000:001.01.11.21.31.41.51.61.71.81.92.0 @@ -609,7 +613,7 @@

-Feb-2020Mar-2020Apr-2020May-202012345678910 +Feb-2020Mar-2020Apr-2020May-202012345678910 @@ -653,7 +657,7 @@

-1-Mar3-Mar5-Mar0.00.20.40.60.81.01.21.41.61.82.0 +1-Mar3-Mar5-Mar0.00.20.40.60.81.01.21.41.61.82.0 @@ -697,7 +701,7 @@

-Feb-2020Apr-2020Jun-2020050100150200250 +Feb-2020Apr-2020Jun-2020050100150200250 @@ -741,7 +745,7 @@

-2020-03-012020-03-020.00.20.40.60.81.01.21.41.61.82.0 +2020-03-012020-03-020.00.20.40.60.81.01.21.41.61.82.0 @@ -785,7 +789,7 @@

-2020-03-022020-03-030.00.20.40.60.81.01.21.41.61.82.0 +2020-03-022020-03-030.00.20.40.60.81.01.21.41.61.82.0 @@ -829,7 +833,7 @@

-Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 +Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 @@ -873,7 +877,7 @@

-Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 +Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 @@ -917,7 +921,7 @@

-Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 +Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 @@ -961,7 +965,7 @@

-Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 +Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 @@ -1005,7 +1009,7 @@

-Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 +Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 @@ -1049,7 +1053,7 @@

-Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 +Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 @@ -1093,7 +1097,7 @@

-Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 +Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 @@ -1137,7 +1141,7 @@

-Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 +Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 @@ -1181,7 +1185,7 @@

-Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 +Feb-2020Apr-2020Jun-20200.00.20.40.60.81.01.21.41.61.82.0 diff --git a/tool/src/test/resources/org/datacommons/tool/lint/allfiletypes/output/summary_report.html b/tool/src/test/resources/org/datacommons/tool/lint/allfiletypes/output/summary_report.html index 4d481fb8..8edd6dad 100644 --- a/tool/src/test/resources/org/datacommons/tool/lint/allfiletypes/output/summary_report.html +++ b/tool/src/test/resources/org/datacommons/tool/lint/allfiletypes/output/summary_report.html @@ -696,6 +696,8 @@

StatVar Num Places Num Observations + Min Value + Max Value Num Observation Dates Min Date Max Date @@ -710,6 +712,8 @@

SV1 6 6 + 0 + 1 1 2019 2019 @@ -730,6 +734,8 @@

SV2 6 6 + 2 + 2 1 2019 2019 @@ -793,7 +799,7 @@

-2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 +2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 SV1 @@ -816,7 +822,7 @@

-2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 +2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 @@ -860,7 +866,7 @@

-2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 +2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 SV1 @@ -883,7 +889,7 @@

-2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 +2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 @@ -927,7 +933,7 @@

-2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 +2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 SV1 @@ -950,7 +956,7 @@

-2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 +2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 @@ -994,7 +1000,7 @@

-2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 +2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 SV1 @@ -1017,7 +1023,7 @@

-2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 +2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 @@ -1061,7 +1067,7 @@

-2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 +2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 SV1 @@ -1084,7 +1090,7 @@

-2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 +2018-12-312019-01-010.00.20.40.60.81.01.21.41.61.82.0 @@ -1128,7 +1134,7 @@

-2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 +2018-12-312019-01-011.01.21.41.61.82.02.22.42.62.83.0 SV1 @@ -1151,7 +1157,7 @@

-2018-12-312019-01-01-1.0-0.8-0.6-0.4-0.20.00.20.40.60.81.0 +2018-12-312019-01-01-1.0-0.8-0.6-0.4-0.20.00.20.40.60.81.0 diff --git a/tool/src/test/resources/org/datacommons/tool/lint/statchecks/output/summary_report.html b/tool/src/test/resources/org/datacommons/tool/lint/statchecks/output/summary_report.html index 0632fad2..b0accd4b 100644 --- a/tool/src/test/resources/org/datacommons/tool/lint/statchecks/output/summary_report.html +++ b/tool/src/test/resources/org/datacommons/tool/lint/statchecks/output/summary_report.html @@ -304,6 +304,8 @@

StatVar Num Places Num Observations + Min Value + Max Value Num Observation Dates Min Date Max Date @@ -318,6 +320,8 @@

CumulativeCount_MedicalTest_ConditionCOVID_19_Positive 7 18 + 1 + 8 10 2020-01-30 2020-05-03 @@ -381,7 +385,7 @@

-Feb-2020Mar-2020Apr-2020May-202012345678 +Feb-2020Mar-2020Apr-2020May-202012345678 @@ -425,7 +429,7 @@

-1-Mar3-Mar5-Mar0.00.20.40.60.81.01.21.41.61.82.0 +1-Mar3-Mar5-Mar0.00.20.40.60.81.01.21.41.61.82.0 @@ -469,7 +473,7 @@

-00:0006:0012:0018:0000:003.03.54.04.55.05.56.06.57.0 +00:0006:0012:0018:0000:003.03.54.04.55.05.56.06.57.0 @@ -513,7 +517,7 @@

-2020-03-012020-03-020.00.20.40.60.81.01.21.41.61.82.0 +2020-03-012020-03-020.00.20.40.60.81.01.21.41.61.82.0 @@ -557,7 +561,7 @@

-2020-03-022020-03-032.02.22.42.62.83.03.23.43.63.84.0 +2020-03-022020-03-032.02.22.42.62.83.03.23.43.63.84.0 @@ -601,7 +605,7 @@

-2020-03-022020-03-030.00.20.40.60.81.01.21.41.61.82.0 +2020-03-022020-03-030.00.20.40.60.81.01.21.41.61.82.0 diff --git a/util/src/main/java/org/datacommons/util/CSVReportWriter.java b/util/src/main/java/org/datacommons/util/CSVReportWriter.java index de3a6209..a8684d82 100644 --- a/util/src/main/java/org/datacommons/util/CSVReportWriter.java +++ b/util/src/main/java/org/datacommons/util/CSVReportWriter.java @@ -8,12 +8,17 @@ import org.apache.commons.csv.CSVPrinter; import org.datacommons.util.SummaryReportGenerator.StatVarSummary; +/* + * This class generates a CSV summary report of stats related to a dataset import. + */ class CSVReportWriter { enum ReportHeaders { StatVar, NumPlaces, NumObservations, + MinValue, + MaxValue, NumObservationsDates, MinDate, MaxDate, @@ -35,6 +40,8 @@ public static void writeRecords(Map records, Writer sw) sv, summary.places.size(), summary.numObservations, + summary.minValue, + summary.maxValue, summary.dates.size(), !summary.dates.isEmpty() ? ((TreeSet) (summary.getUniqueDates())).first() @@ -53,4 +60,3 @@ public static void writeRecords(Map records, Writer sw) } } } - diff --git a/util/src/main/java/org/datacommons/util/StatChecker.java b/util/src/main/java/org/datacommons/util/StatChecker.java index 469f54f1..b6c65019 100644 --- a/util/src/main/java/org/datacommons/util/StatChecker.java +++ b/util/src/main/java/org/datacommons/util/StatChecker.java @@ -655,6 +655,13 @@ private synchronized void extractStatVarInfoFromNode(McfGraph.PropertyValues nod if (svDcid.isEmpty()) return; StatVarSummary svMap = svSummaryMap.computeIfAbsent(svDcid, k -> new StatVarSummary()); svMap.numObservations++; + try { + double value = Double.parseDouble(McfUtil.getPropVal(node, Vocabulary.VALUE)); + svMap.minValue = Math.min(svMap.minValue, value); + svMap.maxValue = Math.max(svMap.maxValue, value); + } catch (NumberFormatException e) { + // Ignore if the value is not a number. + } svMap.dates.add(McfUtil.getPropVal(node, Vocabulary.OBSERVATION_DATE)); svMap.places.add(McfUtil.getPropVal(node, Vocabulary.OBSERVATION_ABOUT)); svMap.mMethods.add(McfUtil.getPropVal(node, Vocabulary.MEASUREMENT_METHOD)); diff --git a/util/src/main/java/org/datacommons/util/SummaryReportGenerator.java b/util/src/main/java/org/datacommons/util/SummaryReportGenerator.java index 162263ac..97d7af4a 100644 --- a/util/src/main/java/org/datacommons/util/SummaryReportGenerator.java +++ b/util/src/main/java/org/datacommons/util/SummaryReportGenerator.java @@ -31,7 +31,7 @@ public class SummaryReportGenerator { public static boolean TEST_mode = false; public static final String SUMMARY_REPORT_HTML = "summary_report.html"; -public static final String SUMMARY_REPORT_CSV = "summary_report.csv"; + public static final String SUMMARY_REPORT_CSV = "summary_report.csv"; // An object to save the information about a stat var. This contains all the necessary getters to // access the information in this object from SummaryReport.ftl @@ -48,6 +48,8 @@ public static final class StatVarSummary { Set observationPeriods = new HashSet<>(); // This set will not be populated when StatVarSummary is generated by PlaceSeriesSummary Set dates = new HashSet<>(); + double minValue = Double.MAX_VALUE; + double maxValue = Double.MIN_VALUE; // The following two lists will only be populated for StatVarSummary generated by // PlaceSeriesSummary and the value at index n of seriesValues will correspond to the date at @@ -59,6 +61,14 @@ public int getNumObservations() { return this.numObservations; } + public double getMinValue() { + return this.minValue; + } + + public double getMaxValue() { + return this.maxValue; + } + public Set getPlaces() { return new TreeSet<>(this.places); } @@ -191,7 +201,7 @@ public static void generateReportSummary( data.put("placeSeriesSummaryMap", placeSeriesSummaryMap); Writer file = new FileWriter(Paths.get(outputDir.toString(), SUMMARY_REPORT_HTML).toString()); template.process(data, file); -Writer csvFile = new FileWriter(Paths.get(outputDir.toString(), SUMMARY_REPORT_CSV).toString()); + Writer csvFile = new FileWriter(Paths.get(outputDir.toString(), SUMMARY_REPORT_CSV).toString()); CSVReportWriter.writeRecords(svSummaryMap, csvFile); } diff --git a/util/src/main/resources/SummaryReport.ftl b/util/src/main/resources/SummaryReport.ftl index 197545ea..889191d6 100644 --- a/util/src/main/resources/SummaryReport.ftl +++ b/util/src/main/resources/SummaryReport.ftl @@ -189,6 +189,8 @@ StatVar Num Places Num Observations + Min Value + Max Value Num Observation Dates Min Date Max Date @@ -204,6 +206,8 @@ ${sv} ${svSummary.getPlaces()?size} ${svSummary.getNumObservations()} + ${svSummary.getMinValue()} + ${svSummary.getMaxValue()} ${svSummary.getUniqueDates()?size} ${svSummary.getUniqueDates()?first!""} ${svSummary.getUniqueDates()?last!""} diff --git a/util/src/test/java/org/datacommons/util/CSVReportWriterTest.java b/util/src/test/java/org/datacommons/util/CSVReportWriterTest.java index c51343f1..981738a1 100644 --- a/util/src/test/java/org/datacommons/util/CSVReportWriterTest.java +++ b/util/src/test/java/org/datacommons/util/CSVReportWriterTest.java @@ -16,9 +16,9 @@ public class CSVReportWriterTest { public static final String[] HEADERS = {"author", "title"}; public static final String EXPECTED_FILESTREAM = - "StatVar,NumPlaces,NumObservations,NumObservationsDates,MinDate,MaxDate,MeasurementMethods,Units,ScalingFactors,observationPeriods\r\n" - + "Var1,0,6,0,,,[CensusACS5YrSurvey],[],[],[]\r\n" - + "Var2,0,2,2,2020,2025,[CensusACS5YrSurvey],[],[],[]"; + "StatVar,NumPlaces,NumObservations,MinValue,MaxValue,NumObservationsDates,MinDate,MaxDate,MeasurementMethods,Units,ScalingFactors,observationPeriods\r\n" + + "Var1,0,6,10.0,100.0,0,,,[CensusACS5YrSurvey],[],[],[]\r\n" + + "Var2,0,2,5.0,60.0,2,2020,2025,[CensusACS5YrSurvey],[],[],[]"; Map records; @Before @@ -26,10 +26,14 @@ public void setUp() { StatVarSummary countPersonExpectedSummary = new StatVarSummary(); countPersonExpectedSummary.numObservations = 6; countPersonExpectedSummary.mMethods = Set.of("CensusACS5YrSurvey"); + countPersonExpectedSummary.minValue = 10; + countPersonExpectedSummary.maxValue = 100; StatVarSummary countFemaleExpectedSummary = new StatVarSummary(); countFemaleExpectedSummary.numObservations = 2; countFemaleExpectedSummary.mMethods = Set.of("CensusACS5YrSurvey"); countFemaleExpectedSummary.dates = Set.of("2020", "2025"); + countFemaleExpectedSummary.minValue = 5; + countFemaleExpectedSummary.maxValue = 60; records = Collections.unmodifiableMap( @@ -48,4 +52,3 @@ public void csvWriterSuccess() throws IOException { assertEquals(EXPECTED_FILESTREAM, sw.toString().trim()); } } -