Commit e4b61c01 authored by Thibault Hallouin's avatar Thibault Hallouin
Browse files

transpose data in input files

So that the files for the tests look like typical files `evalhyd` would
expect, rather than its transposed version.
Showing with 55 additions and 626 deletions
+55 -626
2520 2520,2270,2130,1950,1820,1680,1590,1560,1570,1450,1410,1370,1350,1280,1230,1290,1320,1210,1160,1120,1130,1120,1100,1070,1050,1060,1590,2280,2300,2480,2250,2800,3490,9270,7180,4210,3160,2600,2260,2630,5160,5430,4420,8780,5270,3890,3840,4120,3410,2840,2530,2200,1960,1810,1820,2470,2980,3710,3160,4330,3760,4300,3200,9720,10200,5410,3980,4560,4290,3560,3140,2860,2530,2300,2120,1890,1770,1690,1620,1550,1490,1380,1320,1290,1270,1230,1200,1210,1430,1220,1200,1250,1200,1100,1080,1060,1030,1000,977,965,944,924,910,873,829,805,776,753,735,728,706,689,661,638,635,629,639,725,712,870,856,1120,886,722,738,997,723,642,610,593,1930,1740,1470,3100,1740,1190,949,798,725,653,618,590,3210,2120,1080,864,749,660,608,585,563,538,504,494,1070,717,660,803,654,666,796,899,843,698,1040,681,804,2810,1630,1360,1000,768,631,595,548,498,523,604,568,691,509,459,564,468,421,414,406,398,385,350,329,322,332,322,302,315,378,420,374,309,262,236,234,230,215,218,206,202,200,199,196,193,207,651,529,466,347,279,252,226,205,179,192,200,215,236,281,217,340,314,282,228,195,192,199,186,177,161,157,395,509,1020,704,394,354,299,268,245,258,277,255,241,225,223,229,227,224,220,218,228,241,242,257,249,261,309,495,675,416,398,360,729,491,402,467,1200,622,424,420,552,447,374,657,588,593,480,419,409,723,731,744,565,503,468,455,1270,1730,967,2290,1790,1090,946,791,734,719,681,758,934,814,737,707
2270
2130
1950
1820
1680
1590
1560
1570
1450
1410
1370
1350
1280
1230
1290
1320
1210
1160
1120
1130
1120
1100
1070
1050
1060
1590
2280
2300
2480
2250
2800
3490
9270
7180
4210
3160
2600
2260
2630
5160
5430
4420
8780
5270
3890
3840
4120
3410
2840
2530
2200
1960
1810
1820
2470
2980
3710
3160
4330
3760
4300
3200
9720
10200
5410
3980
4560
4290
3560
3140
2860
2530
2300
2120
1890
1770
1690
1620
1550
1490
1380
1320
1290
1270
1230
1200
1210
1430
1220
1200
1250
1200
1100
1080
1060
1030
1000
977
965
944
924
910
873
829
805
776
753
735
728
706
689
661
638
635
629
639
725
712
870
856
1120
886
722
738
997
723
642
610
593
1930
1740
1470
3100
1740
1190
949
798
725
653
618
590
3210
2120
1080
864
749
660
608
585
563
538
504
494
1070
717
660
803
654
666
796
899
843
698
1040
681
804
2810
1630
1360
1000
768
631
595
548
498
523
604
568
691
509
459
564
468
421
414
406
398
385
350
329
322
332
322
302
315
378
420
374
309
262
236
234
230
215
218
206
202
200
199
196
193
207
651
529
466
347
279
252
226
205
179
192
200
215
236
281
217
340
314
282
228
195
192
199
186
177
161
157
395
509
1020
704
394
354
299
268
245
258
277
255
241
225
223
229
227
224
220
218
228
241
242
257
249
261
309
495
675
416
398
360
729
491
402
467
1200
622
424
420
552
447
374
657
588
593
480
419
409
723
731
744
565
503
468
455
1270
1730
967
2290
1790
1090
946
791
734
719
681
758
934
814
737
707
This diff is collapsed.
...@@ -13,14 +13,14 @@ TEST(DeterministTests, TestNSE) { ...@@ -13,14 +13,14 @@ TEST(DeterministTests, TestNSE) {
// read in data // read in data
std::ifstream ifs; std::ifstream ifs;
ifs.open("./data/q_obs.csv"); ifs.open("./data/q_obs.csv");
xt::xtensor<double, 2> observed_2d = xt::transpose(xt::load_csv<int>(ifs)); xt::xtensor<double, 2> observed_2d =xt::load_csv<int>(ifs);
ifs.close(); ifs.close();
xt::xtensor<double, 1> observed_1d = xt::squeeze(observed_2d); xt::xtensor<double, 1> observed_1d = xt::squeeze(observed_2d);
ifs.open("./data/q_prd.csv"); ifs.open("./data/q_prd.csv");
xt::xtensor<double, 2> predicted_2d = xt::view( xt::xtensor<double, 2> predicted_2d = xt::view(
xt::transpose(xt::load_csv<double>(ifs)), xt::range(0, 5), xt::all() xt::load_csv<double>(ifs), xt::range(0, 5), xt::all()
); );
ifs.close(); ifs.close();
......
...@@ -24,8 +24,7 @@ TEST(ProbabilistTests, TestBrier) { ...@@ -24,8 +24,7 @@ TEST(ProbabilistTests, TestBrier) {
std::vector<xt::xtensor<double, 2>> metrics = std::vector<xt::xtensor<double, 2>> metrics =
evalhyd::evalp( evalhyd::evalp(
xt::transpose(observed), xt::transpose(predicted), observed, predicted, {"BS", "BSS", "BS_CRD", "BS_LBD"},
{"BS", "BSS", "BS_CRD", "BS_LBD"},
thresholds thresholds
); );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment