Repository navigation
Commit 7ebcfbc
authored
fix: locate a workbook cell that does not fit a reading among its outliers (#194)
`TypeHypothesis.Outliers` promises where the values a reading does not
account for stand. For a cell whose type the workbook states, that
promise was not kept. A number in a column of xlsx or ods dates, for
example Excel's phantom 29 February 1900, which reads as its number
since #189, was counted in `UnmatchedCount`, but no outlier gave its
row. The profiler located only text cells that failed to parse. Native
cells went to `AcceptNativeNumber`/`AcceptNativeDate` and were never
located for the readings they did not fit. In a column the file declared
entirely, `HypothesisBuilder` also passed empty outlier lists. Noticed
while fixing serial 60 for #184.
What changes:
- `ColumnProfiler`, for each culture:
- a native number is a date outlier;
- a native date is a numeric outlier;
- a native boolean is both;
- each is recorded with its row and text, up to `OutlierSampleSize`, in
row order with the text cells.
- `HypothesisBuilder.AddDeclared` passes the date and numeric outliers
to the date and number readings instead of empty lists.
This also helps mixed columns of text and native cells. Their parsed
readings now list the native cells that do not fit as well.
Cost: one count comparison per culture for each native cell, once the
first `OutlierSampleSize` are taken. Benchmark: see the comment below.
Tests in `ColumnProfilerTests`:
- dates with a number and a boolean list the right rows for both
readings, and the date hypothesis lists them too;
- the outlier limit holds.1 parent 9cebf23 commit 7ebcfbc
3 files changed
Lines changed: 71 additions & 4 deletions
File tree
- src/TriasDev.Tabular/Analysis
- tests/TriasDev.Tabular.Tests/Analysis
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
140 | 149 | | |
141 | 150 | | |
142 | 151 | | |
143 | 152 | | |
144 | 153 | | |
145 | 154 | | |
| 155 | + | |
146 | 156 | | |
147 | 157 | | |
148 | 158 | | |
| |||
151 | 161 | | |
152 | 162 | | |
153 | 163 | | |
| 164 | + | |
154 | 165 | | |
155 | 166 | | |
156 | 167 | | |
| |||
610 | 621 | | |
611 | 622 | | |
612 | 623 | | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
613 | 644 | | |
614 | 645 | | |
615 | 646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
323 | 359 | | |
0 commit comments