diff --git a/pelicun/tests/basic/test_loss_model.py b/pelicun/tests/basic/test_loss_model.py index a698da019..d4aab645f 100644 --- a/pelicun/tests/basic/test_loss_model.py +++ b/pelicun/tests/basic/test_loss_model.py @@ -172,7 +172,7 @@ def test___init__(self, loss_model: LossModel) -> None: assert len(loss_model._loss_models) == 2 def test_decision_variables(self, loss_model: LossModel) -> None: - dvs = ('Carbon', 'Cost', 'Energy', 'Time') + dvs = ('Cost', 'Time') assert loss_model.decision_variables == dvs assert loss_model.ds_model.decision_variables == dvs assert loss_model.lf_model.decision_variables == dvs @@ -337,14 +337,15 @@ def test_aggregate_losses_when_no_loss( ) -> None: # tests that aggregate losses works when there is no loss. loss_model = LossModel(assessment_instance) + loss_model.decision_variables = ('Cost', 'Time', 'Carbon', 'Energy') df_agg = loss_model.aggregate_losses() assert isinstance(df_agg, pd.DataFrame) pd.testing.assert_frame_equal( df_agg, pd.DataFrame( { - 'repair_carbon': 0.0, 'repair_cost': 0.00, + 'repair_carbon': 0.0, 'repair_energy': 0.00, 'repair_time-sequential': 0.00, 'repair_time-parallel': 0.00, diff --git a/pelicun/tests/dl_calculation/e1/test_e1.py b/pelicun/tests/dl_calculation/e1/test_e1.py index 681e88aa8..1db78a984 100644 --- a/pelicun/tests/dl_calculation/e1/test_e1.py +++ b/pelicun/tests/dl_calculation/e1/test_e1.py @@ -84,18 +84,17 @@ def test_dl_calculation_1(obtain_temp_dir: str) -> None: os.chdir(temp_dir) # run - with pytest.warns(PelicunWarning): - run_pelicun( - demand_file='response.csv', - config_path='8000-AIM.json', - output_path=None, - coupled_edp=True, - realizations=100, - auto_script_path='PelicunDefault/Hazus_Earthquake_IM.py', - detailed_results=False, - output_format=None, - custom_model_dir=None, - ) + run_pelicun( + demand_file='response.csv', + config_path='8000-AIM.json', + output_path=None, + coupled_edp=True, + realizations=100, + auto_script_path='PelicunDefault/Hazus_Earthquake_IM.py', + detailed_results=False, + output_format=None, + custom_model_dir=None, + ) # # Test files diff --git a/pelicun/tests/dl_calculation/e1_no_autopop/test_e1.py b/pelicun/tests/dl_calculation/e1_no_autopop/test_e1.py index a41305702..8f823c815 100644 --- a/pelicun/tests/dl_calculation/e1_no_autopop/test_e1.py +++ b/pelicun/tests/dl_calculation/e1_no_autopop/test_e1.py @@ -84,18 +84,17 @@ def test_dl_calculation_1(obtain_temp_dir: str) -> None: os.chdir(temp_dir) # run - with pytest.warns(PelicunWarning): - run_pelicun( - demand_file='response.csv', - config_path='8000-AIM.json', - output_path=None, - coupled_edp=True, - realizations=100, - auto_script_path=None, - detailed_results=False, - output_format=None, - custom_model_dir=None, - ) + run_pelicun( + demand_file='response.csv', + config_path='8000-AIM.json', + output_path=None, + coupled_edp=True, + realizations=100, + auto_script_path=None, + detailed_results=False, + output_format=None, + custom_model_dir=None, + ) # # Test files diff --git a/pelicun/tests/dl_calculation/e2/test_e2.py b/pelicun/tests/dl_calculation/e2/test_e2.py index dab04ab04..d9ed638e5 100644 --- a/pelicun/tests/dl_calculation/e2/test_e2.py +++ b/pelicun/tests/dl_calculation/e2/test_e2.py @@ -80,18 +80,17 @@ def test_dl_calculation_2(obtain_temp_dir: tuple[str, str]) -> None: os.chdir(temp_dir) # run - with pytest.warns(PelicunWarning): - run_pelicun( - demand_file='response.csv', - config_path='1-AIM.json', - output_path=None, - coupled_edp=True, - realizations=100, - auto_script_path='PelicunDefault/Hazus_Earthquake_Story.py', - detailed_results=False, - output_format=None, - custom_model_dir=None, - ) + run_pelicun( + demand_file='response.csv', + config_path='1-AIM.json', + output_path=None, + coupled_edp=True, + realizations=100, + auto_script_path='PelicunDefault/Hazus_Earthquake_Story.py', + detailed_results=False, + output_format=None, + custom_model_dir=None, + ) # # Test files diff --git a/pelicun/tests/dl_calculation/e3/test_e3.py b/pelicun/tests/dl_calculation/e3/test_e3.py index 3370abdf7..11745c4d4 100644 --- a/pelicun/tests/dl_calculation/e3/test_e3.py +++ b/pelicun/tests/dl_calculation/e3/test_e3.py @@ -78,18 +78,17 @@ def test_dl_calculation_3(obtain_temp_dir: tuple[str, str]) -> None: os.chdir(temp_dir) # run - with pytest.warns(PelicunWarning): - run_pelicun( - demand_file='response.csv', - config_path='170-AIM.json', - output_path=None, - coupled_edp=False, - realizations=100, - auto_script_path='PelicunDefault/Hazus_Earthquake_Story.py', - detailed_results=False, - output_format=None, - custom_model_dir=None, - ) + run_pelicun( + demand_file='response.csv', + config_path='170-AIM.json', + output_path=None, + coupled_edp=False, + realizations=100, + auto_script_path='PelicunDefault/Hazus_Earthquake_Story.py', + detailed_results=False, + output_format=None, + custom_model_dir=None, + ) # # Test files diff --git a/pelicun/tests/dl_calculation/e4/test_e4.py b/pelicun/tests/dl_calculation/e4/test_e4.py index f4cbd6278..45544beeb 100644 --- a/pelicun/tests/dl_calculation/e4/test_e4.py +++ b/pelicun/tests/dl_calculation/e4/test_e4.py @@ -83,18 +83,17 @@ def test_dl_calculation_4(obtain_temp_dir: tuple[str, str]) -> None: os.chdir(temp_dir) # run - with pytest.warns(PelicunWarning): - run_pelicun( - demand_file='response.csv', - config_path='0-AIM.json', - output_path=None, - coupled_edp=True, - realizations=100, - auto_script_path='PelicunDefault/Hazus_Earthquake_Story.py', - detailed_results=False, - output_format=None, - custom_model_dir=None, - ) + run_pelicun( + demand_file='response.csv', + config_path='0-AIM.json', + output_path=None, + coupled_edp=True, + realizations=100, + auto_script_path='PelicunDefault/Hazus_Earthquake_Story.py', + detailed_results=False, + output_format=None, + custom_model_dir=None, + ) # # Test files diff --git a/pelicun/tests/dl_calculation/e5/test_e5.py b/pelicun/tests/dl_calculation/e5/test_e5.py index ae1b71d30..451afb654 100644 --- a/pelicun/tests/dl_calculation/e5/test_e5.py +++ b/pelicun/tests/dl_calculation/e5/test_e5.py @@ -83,18 +83,17 @@ def test_dl_calculation_5(obtain_temp_dir: tuple[str, str]) -> None: os.chdir(temp_dir) # run - with pytest.warns(PelicunWarning): - run_pelicun( - demand_file='response.csv', - config_path='1-AIM.json', - output_path=None, - coupled_edp=True, - realizations=100, - auto_script_path='PelicunDefault/Hazus_Earthquake_IM.py', - detailed_results=False, - output_format=None, - custom_model_dir=None, - ) + run_pelicun( + demand_file='response.csv', + config_path='1-AIM.json', + output_path=None, + coupled_edp=True, + realizations=100, + auto_script_path='PelicunDefault/Hazus_Earthquake_IM.py', + detailed_results=False, + output_format=None, + custom_model_dir=None, + ) # # Test files diff --git a/pelicun/tests/dl_calculation/e6/test_e6.py b/pelicun/tests/dl_calculation/e6/test_e6.py index d71997b4e..5f6c9cf71 100644 --- a/pelicun/tests/dl_calculation/e6/test_e6.py +++ b/pelicun/tests/dl_calculation/e6/test_e6.py @@ -83,18 +83,17 @@ def test_dl_calculation_6(obtain_temp_dir: tuple[str, str]) -> None: os.chdir(temp_dir) # run - with pytest.warns(PelicunWarning): - run_pelicun( - demand_file='response.csv', - config_path='1-AIM.json', - output_path=None, - coupled_edp=True, - realizations=100, - auto_script_path='PelicunDefault/Hazus_Earthquake_IM.py', - detailed_results=False, - output_format=None, - custom_model_dir=None, - ) + run_pelicun( + demand_file='response.csv', + config_path='1-AIM.json', + output_path=None, + coupled_edp=True, + realizations=100, + auto_script_path='PelicunDefault/Hazus_Earthquake_IM.py', + detailed_results=False, + output_format=None, + custom_model_dir=None, + ) # # Test files diff --git a/pelicun/tests/dl_calculation/e7/test_e7.py b/pelicun/tests/dl_calculation/e7/test_e7.py index a246ada1b..9f16c2697 100644 --- a/pelicun/tests/dl_calculation/e7/test_e7.py +++ b/pelicun/tests/dl_calculation/e7/test_e7.py @@ -95,18 +95,17 @@ def test_dl_calculation_7(obtain_temp_dir: tuple[str, str]) -> None: os.chdir(temp_dir) # run - with pytest.warns(PelicunWarning): - run_pelicun( - demand_file='response.csv', - config_path='1-AIM.json', - output_path=None, - coupled_edp=True, - realizations=100, - auto_script_path='auto_HU_NJ.py', - detailed_results=False, - output_format=None, - custom_model_dir=None, - ) + run_pelicun( + demand_file='response.csv', + config_path='1-AIM.json', + output_path=None, + coupled_edp=True, + realizations=100, + auto_script_path='auto_HU_NJ.py', + detailed_results=False, + output_format=None, + custom_model_dir=None, + ) # now remove the ruleset files and auto script for file_path in ruleset_files: diff --git a/pelicun/tests/dl_calculation/e8/test_e8.py b/pelicun/tests/dl_calculation/e8/test_e8.py index f098718ef..040f13c4d 100644 --- a/pelicun/tests/dl_calculation/e8/test_e8.py +++ b/pelicun/tests/dl_calculation/e8/test_e8.py @@ -94,18 +94,17 @@ def test_dl_calculation_8(obtain_temp_dir: tuple[str, str]) -> None: os.chdir(temp_dir) # run - with pytest.warns(PelicunWarning): - run_pelicun( - demand_file='response.csv', - config_path='1-AIM.json', - output_path=None, - coupled_edp=True, - realizations=100, - auto_script_path='auto_HU_LA.py', - detailed_results=False, - output_format=None, - custom_model_dir=None, - ) + run_pelicun( + demand_file='response.csv', + config_path='1-AIM.json', + output_path=None, + coupled_edp=True, + realizations=100, + auto_script_path='auto_HU_LA.py', + detailed_results=False, + output_format=None, + custom_model_dir=None, + ) # now remove the ruleset files and auto script for file_path in ruleset_files: diff --git a/pelicun/tests/dl_calculation/e9/custom_pop.py b/pelicun/tests/dl_calculation/e9/custom_pop.py index 47727249c..519433a2f 100644 --- a/pelicun/tests/dl_calculation/e9/custom_pop.py +++ b/pelicun/tests/dl_calculation/e9/custom_pop.py @@ -80,7 +80,7 @@ def auto_populate(aim): "Damage": {"DamageProcess": "None"}, "Demands": {}, "Losses": { - "BldgRepair": { + "Repair": { "ConsequenceDatabase": "None", "ConsequenceDatabasePath": ( "CustomDLDataFolder/loss_repair_Tsunami.csv" diff --git a/pelicun/tests/dl_calculation/e9/test_e9.py b/pelicun/tests/dl_calculation/e9/test_e9.py index 299e1c7a2..3cf5a5186 100644 --- a/pelicun/tests/dl_calculation/e9/test_e9.py +++ b/pelicun/tests/dl_calculation/e9/test_e9.py @@ -94,18 +94,17 @@ def test_dl_calculation_9(obtain_temp_dir: tuple[str, str]) -> None: os.chdir(temp_dir) # run - with pytest.warns(PelicunWarning): - run_pelicun( - demand_file='response.csv', - config_path='3500-AIM.json', - output_path=None, - coupled_edp=True, - realizations=100, - auto_script_path='custom_pop.py', - detailed_results=False, - output_format=None, - custom_model_dir='./CustomDLModels', - ) + run_pelicun( + demand_file='response.csv', + config_path='3500-AIM.json', + output_path=None, + coupled_edp=True, + realizations=100, + auto_script_path='custom_pop.py', + detailed_results=False, + output_format=None, + custom_model_dir='./CustomDLModels', + ) # now remove the ruleset files and auto script for file_path in ruleset_files: