(result, expected)
| 24 | return array |
| 25 | |
| 26 | def CompareTables(result, expected): |
| 27 | if result.GetNumberOfColumns() != expected.GetNumberOfColumns(): |
| 28 | print(' ERROR: Column count mismatch') |
| 29 | return False |
| 30 | status = True |
| 31 | for cc in range(result.GetNumberOfColumns()): |
| 32 | rc = result.GetColumn(cc) |
| 33 | ec = expected.GetColumnByName(rc.GetName()) |
| 34 | if rc.IsNumeric() and ec.IsNumeric(): |
| 35 | nn = rc.GetNumberOfTuples() |
| 36 | for ii in range(nn): |
| 37 | rv = np.array(rc.GetTuple(ii)) |
| 38 | ev = np.array(ec.GetTuple(ii)) |
| 39 | if np.any(rv != ev): |
| 40 | srv = ' '.join([str(xx) for xx in rv]) |
| 41 | sev = ' '.join([str(xx) for xx in ev]) |
| 42 | print(f' ERROR: {rc.GetName()} values mismatched at row {ii}: {srv}, expected {sev}') |
| 43 | status = False |
| 44 | else: |
| 45 | nn = rc.GetNumberOfValues() |
| 46 | for ii in range(nn): |
| 47 | rv = rc.GetValue(ii) |
| 48 | ev = ec.GetValue(ii) |
| 49 | if rv != ev: |
| 50 | print(f' ERROR: {rc.GetName()} values mismatched at row {ii}: {rv}, expected {ev}') |
| 51 | status = False |
| 52 | return status |
| 53 | |
| 54 | def TestAggregation(algo, model, summaryTab, histoTab, expected): |
| 55 | """Test that aggregating a statistical model with a copy of itself is computed properly.""" |
no test coverage detected