4141from climada .entity import Exposures , ImpactFunc , ImpactFuncSet
4242from climada .entity .entity_def import Entity
4343from climada .hazard import Hazard
44- from climada .util . api_client import Client
44+ from climada .test import get_test_file
4545from climada .util .constants import (
4646 ENT_DEMO_FUTURE ,
4747 ENT_DEMO_TODAY ,
48- EXP_DEMO_H5 ,
4948 HAZ_DEMO_H5 ,
5049 TEST_UNC_OUTPUT_COSTBEN ,
5150 TEST_UNC_OUTPUT_IMPACT ,
5251)
5352
54- test_unc_output_impact = Client ().get_dataset_file (
55- name = TEST_UNC_OUTPUT_IMPACT , status = "test_dataset"
56- )
57- test_unc_output_costben = Client ().get_dataset_file (
58- name = TEST_UNC_OUTPUT_COSTBEN , status = "test_dataset"
59- )
53+ EXP_DEMO_H5 = get_test_file ("exp_demo_today" , file_format = "hdf5" )
54+ test_unc_output_impact = get_test_file (TEST_UNC_OUTPUT_IMPACT )
55+ test_unc_output_costben = get_test_file (TEST_UNC_OUTPUT_COSTBEN )
6056
6157
6258def impf_dem (x_paa = 1 , x_mdd = 1 ):
@@ -578,7 +574,7 @@ def test_calc_sensitivity_all_pass(self):
578574 "sensitivity_kwargs" : {"S" : 10 , "seed" : 12345 },
579575 "test_param_name" : ["x_exp" , 0 ],
580576 "test_si_name" : ["CV" , 16 ],
581- "test_si_value" : [0.25000 , 2 ],
577+ "test_si_value" : [0.250000 , 2 ],
582578 },
583579 "hdmr" : {
584580 "sampling_method" : "saltelli" ,
@@ -587,7 +583,7 @@ def test_calc_sensitivity_all_pass(self):
587583 "sensitivity_kwargs" : {},
588584 "test_param_name" : ["x_exp" , 2 ],
589585 "test_si_name" : ["Sa" , 4 ],
590- "test_si_value" : [0.004658 , 3 ],
586+ "test_si_value" : [0.004649 , 3 ],
591587 },
592588 "ff" : {
593589 "sampling_method" : "ff" ,
@@ -618,7 +614,7 @@ def test_calc_sensitivity_all_pass(self):
618614 },
619615 "test_param_name" : ["x_exp" , 0 ],
620616 "test_si_name" : ["dgsm" , 8 ],
621- "test_si_value" : [1.697516e-01 , 9 ],
617+ "test_si_value" : [0.1697516 , 9 ],
622618 },
623619 "fast" : {
624620 "sampling_method" : "fast_sampler" ,
@@ -627,7 +623,7 @@ def test_calc_sensitivity_all_pass(self):
627623 "sensitivity_kwargs" : {"M" : 4 , "seed" : 12345 },
628624 "test_param_name" : ["x_exp" , 0 ],
629625 "test_si_name" : ["S1_conf" , 8 ],
630- "test_si_value" : [0.671396 , 1 ],
626+ "test_si_value" : [0.671546 , 1 ],
631627 },
632628 "rbd_fast" : {
633629 "sampling_method" : "saltelli" ,
@@ -636,7 +632,7 @@ def test_calc_sensitivity_all_pass(self):
636632 "sensitivity_kwargs" : {"M" : 4 , "seed" : 12345 },
637633 "test_param_name" : ["x_exp" , 0 ],
638634 "test_si_name" : ["S1_conf" , 4 ],
639- "test_si_value" : [0.152609 , 4 ],
635+ "test_si_value" : [0.129919 , 4 ],
640636 },
641637 "morris" : {
642638 "sampling_method" : "morris" ,
@@ -645,7 +641,7 @@ def test_calc_sensitivity_all_pass(self):
645641 "sensitivity_kwargs" : {},
646642 "test_param_name" : ["x_exp" , 0 ],
647643 "test_si_name" : ["mu" , 1 ],
648- "test_si_value" : [5066460029.63911 , 8 ],
644+ "test_si_value" : [7935400297.813827 , 8 ],
649645 },
650646 }
651647
@@ -700,7 +696,7 @@ def test_sensitivity_method(
700696 haz_unc ,
701697 sensitivity_method ,
702698 method_params ,
703- places = 2 if sensitivity_method == "rbd_fast" else 5 ,
699+ places = 5 ,
704700 )
705701
706702
0 commit comments