@@ -353,7 +353,7 @@ def test__get_num_points_pair():
353
353
)
354
354
355
355
# Test that df_count and df_expected are essentially equal
356
- assert_frame_equal (df_count , df_expected , check_row_order = False , check_dtype = False )
356
+ assert_frame_equal (df_count , df_expected , check_row_order = False , check_dtypes = False )
357
357
358
358
359
359
def test_compute_covariance ():
@@ -474,7 +474,7 @@ def test_fill_cov_with_var_dont_fill_all():
474
474
475
475
filled_df = _fill_cov_with_var (test_df , test_cols = ["pow_000" , "pow_001" ], fill_all = False )
476
476
477
- assert_frame_equal (filled_df , expected_df , check_row_order = False , check_dtype = False )
477
+ assert_frame_equal (filled_df , expected_df , check_row_order = False , check_dtypes = False )
478
478
479
479
480
480
def test_fill_cov_with_var_fill_all ():
@@ -513,7 +513,7 @@ def test_fill_cov_with_var_fill_all():
513
513
514
514
filled_df = _fill_cov_with_var (test_df , test_cols = ["pow_000" , "pow_001" ], fill_all = True )
515
515
516
- assert_frame_equal (filled_df , expected_df , check_row_order = False , check_dtype = False )
516
+ assert_frame_equal (filled_df , expected_df , check_row_order = False , check_dtypes = False )
517
517
518
518
519
519
def test_set_cov_to_zero ():
@@ -552,7 +552,7 @@ def test_set_cov_to_zero():
552
552
553
553
zero_cov_df = _set_cov_to_zero (test_df , test_cols = ["pow_000" , "pow_001" ])
554
554
555
- assert_frame_equal (zero_cov_df , expected_df , check_row_order = False , check_dtype = False )
555
+ assert_frame_equal (zero_cov_df , expected_df , check_row_order = False , check_dtypes = False )
556
556
557
557
558
558
def test_synchronize_cov_nulls_back_to_mean ():
@@ -599,7 +599,7 @@ def test_synchronize_cov_nulls_back_to_mean():
599
599
test_cols = ["pow_000" , "pow_001" ],
600
600
)
601
601
602
- assert_frame_equal (df_res , expected_df_bin , check_row_order = False , check_dtype = False )
602
+ assert_frame_equal (df_res , expected_df_bin , check_row_order = False , check_dtypes = False )
603
603
604
604
605
605
def test_total_uplift_expected_power_with_standard_error ():
@@ -624,7 +624,7 @@ def test_total_uplift_expected_power_with_standard_error():
624
624
625
625
626
626
def test_center_uplift_identical ():
627
- a_in = load_data ()
627
+ a_in = load_repeated_data ()
628
628
629
629
epao_single = total_uplift_expected_power (
630
630
a_in = a_in ,
@@ -667,10 +667,91 @@ def test_center_uplift_identical():
667
667
use_standard_error = True ,
668
668
)
669
669
670
- # print(epao_single.uplift_results)
671
- # print(epao_boot.uplift_results)
672
- # print(epao_standard.uplift_results)
673
-
674
670
assert epao_single .uplift_results ["scada_uplift" ] == 1.1
675
671
assert epao_boot .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ] == 1.1
676
672
assert epao_standard .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ] == 1.1
673
+
674
+
675
+ def test_uncertain_intervals ():
676
+ a_in = load_repeated_data ()
677
+
678
+ epao_boot = total_uplift_expected_power (
679
+ a_in = a_in ,
680
+ uplift_pairs = [("baseline" , "wake_steering" )],
681
+ uplift_names = ["scada_uplift" ],
682
+ test_turbines = [0 , 1 ],
683
+ use_predefined_wd = True ,
684
+ use_predefined_ws = True ,
685
+ wd_step = 1.0 ,
686
+ wd_min = 0.5 ,
687
+ ws_min = 0.5 ,
688
+ use_standard_error = False ,
689
+ N = 10 ,
690
+ )
691
+
692
+ epao_standard_zero = total_uplift_expected_power (
693
+ a_in = a_in ,
694
+ uplift_pairs = [("baseline" , "wake_steering" )],
695
+ uplift_names = ["scada_uplift" ],
696
+ test_turbines = [0 , 1 ],
697
+ use_predefined_wd = True ,
698
+ use_predefined_ws = True ,
699
+ wd_step = 1.0 ,
700
+ wd_min = 0.5 ,
701
+ ws_min = 0.5 ,
702
+ use_standard_error = True ,
703
+ set_cov_to_zero_or_var = "zero" ,
704
+ )
705
+
706
+ epao_standard_var = total_uplift_expected_power (
707
+ a_in = a_in ,
708
+ uplift_pairs = [("baseline" , "wake_steering" )],
709
+ uplift_names = ["scada_uplift" ],
710
+ test_turbines = [0 , 1 ],
711
+ use_predefined_wd = True ,
712
+ use_predefined_ws = True ,
713
+ wd_step = 1.0 ,
714
+ wd_min = 0.5 ,
715
+ ws_min = 0.5 ,
716
+ use_standard_error = True ,
717
+ set_cov_to_zero_or_var = "var" ,
718
+ )
719
+
720
+ print ("Bootstrapping" )
721
+ print (epao_boot .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ])
722
+ print (epao_boot .uplift_results ["scada_uplift" ]["energy_uplift_lb" ])
723
+ print (epao_boot .uplift_results ["scada_uplift" ]["energy_uplift_ub" ])
724
+ assert (
725
+ epao_boot .uplift_results ["scada_uplift" ]["energy_uplift_lb" ]
726
+ <= epao_boot .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ]
727
+ )
728
+ assert (
729
+ epao_boot .uplift_results ["scada_uplift" ]["energy_uplift_ub" ]
730
+ >= epao_boot .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ]
731
+ )
732
+
733
+ print ("Standard error zero" )
734
+ print (epao_standard_zero .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ])
735
+ print (epao_standard_zero .uplift_results ["scada_uplift" ]["energy_uplift_lb" ])
736
+ print (epao_standard_zero .uplift_results ["scada_uplift" ]["energy_uplift_ub" ])
737
+ assert (
738
+ epao_standard_zero .uplift_results ["scada_uplift" ]["energy_uplift_lb" ]
739
+ <= epao_standard_zero .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ]
740
+ )
741
+ assert (
742
+ epao_standard_zero .uplift_results ["scada_uplift" ]["energy_uplift_ub" ]
743
+ >= epao_standard_zero .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ]
744
+ )
745
+
746
+ print ("Standard error var" )
747
+ print (epao_standard_var .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ])
748
+ print (epao_standard_var .uplift_results ["scada_uplift" ]["energy_uplift_lb" ])
749
+ print (epao_standard_var .uplift_results ["scada_uplift" ]["energy_uplift_ub" ])
750
+ assert (
751
+ epao_standard_var .uplift_results ["scada_uplift" ]["energy_uplift_lb" ]
752
+ <= epao_standard_var .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ]
753
+ )
754
+ assert (
755
+ epao_standard_var .uplift_results ["scada_uplift" ]["energy_uplift_ub" ]
756
+ >= epao_standard_var .uplift_results ["scada_uplift" ]["energy_uplift_ctr" ]
757
+ )
0 commit comments