From 4c2b3b64bf3ba0c553bacc1c6022880536e24da4 Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Wed, 30 Mar 2022 13:41:37 +0200 Subject: [PATCH 1/7] Update requirements.txt --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2deeb8b..aa410c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -matplotlib==3.0.0 oemof.network==0.4.0rc0 oemof.solph==0.4.1 oemof.tools==0.4.0 @@ -8,3 +7,5 @@ Pyomo==5.7.0 scipy==1.4.1 xlrd==1.2.0 xlsxwriter==1.2.7 +matplotlib +numpy==1.19.4 From 79ed90be82705b86331027ec41126eaf84420a42 Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Tue, 16 Jul 2024 16:21:37 +0200 Subject: [PATCH 2/7] Upgrade pandas version --- requirements.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index aa410c9..c199bef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,10 @@ oemof.network==0.4.0rc0 oemof.solph==0.4.1 oemof.tools==0.4.0 -pandas==0.23.4 -pip==21.1 +pandas>=1.4.1 Pyomo==5.7.0 scipy==1.4.1 xlrd==1.2.0 xlsxwriter==1.2.7 matplotlib -numpy==1.19.4 +numpy==1.19.4 \ No newline at end of file From 61305bfad8c0cb7aafdf76eca2bb6ee3a1b58f83 Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Sun, 3 Apr 2022 23:17:42 +0200 Subject: [PATCH 3/7] Silence pandas warning --- src/A1_general_functions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/A1_general_functions.py b/src/A1_general_functions.py index 50250aa..6e3c06c 100644 --- a/src/A1_general_functions.py +++ b/src/A1_general_functions.py @@ -3,6 +3,7 @@ """ import pandas as pd +import numpy as np from src.constants import ( CAPACITY_PV_KWP, CAPACITY_WIND_KW, @@ -103,7 +104,7 @@ def store_result_matrix(overall_results, experiment, oemof_results): """ round_to_comma = 5 - result_series = pd.Series() + result_series = pd.Series(dtype=np.float64) for key in overall_results.columns.values: # Check if called value is in oemof results -> Remember: check if pandas index has certain index: pd.object.index.contains(key) From 6d36ddb9d437137dfe69f4de367a9ad9dde1f975 Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Sun, 3 Apr 2022 23:18:19 +0200 Subject: [PATCH 4/7] Replace pandas deprecated append by concat --- src/A1_general_functions.py | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/A1_general_functions.py b/src/A1_general_functions.py index 6e3c06c..d95f69d 100644 --- a/src/A1_general_functions.py +++ b/src/A1_general_functions.py @@ -110,33 +110,27 @@ def store_result_matrix(overall_results, experiment, oemof_results): # Check if called value is in oemof results -> Remember: check if pandas index has certain index: pd.object.index.contains(key) if key in oemof_results: if isinstance(oemof_results[key], str): - result_series = result_series.append( - pd.Series([oemof_results[key]], index=[key]) - ) + result_series = pd.concat([result_series, pd.Series([oemof_results[key]], index=[key])]) else: - result_series = result_series.append( - pd.Series([round(oemof_results[key], round_to_comma)], index=[key]) - ) + result_series = pd.concat([result_series, pd.Series([round(oemof_results[key], round_to_comma)], index=[key])]) # extend by item of demand profile elif key == DEMAND_PROFILE: - result_series = result_series.append( + result_series = pd.concat([result_series, pd.Series([experiment[key]], index=[key]) - ) + ]) # Check if called value is a parameter of sensitivity_experiment_s elif key in experiment: if isinstance(experiment[key], str): - result_series = result_series.append( + result_series = pd.concat([result_series, pd.Series([experiment[key]], index=[key]) - ) + ]) else: - result_series = result_series.append( + result_series = pd.concat([result_series, pd.Series([round(experiment[key], round_to_comma)], index=[key]) - ) + ]) result_series = result_series.reindex(overall_results.columns, fill_value=None) - overall_results = overall_results.append( - pd.Series(result_series), ignore_index=True - ) + overall_results = pd.concat([overall_results, result_series.to_frame().T], ignore_index=True) return overall_results From d6785a5c36fc8c4addb7f884218cb8d4a953d045 Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Sun, 3 Apr 2022 23:18:48 +0200 Subject: [PATCH 5/7] Replace pandas deprecated clip_upper by clip(upper= --- src/G2b_constraints_custom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/G2b_constraints_custom.py b/src/G2b_constraints_custom.py index debfbff..7cb4e7b 100644 --- a/src/G2b_constraints_custom.py +++ b/src/G2b_constraints_custom.py @@ -233,7 +233,7 @@ def backup_test(case_dict, oemof_results, experiment, e_flows_df): ], index=demand_profile.index, ) - ratio_below_zero = ratio.clip_upper(0) + ratio_below_zero = ratio.clip(upper=0) test_warning(ratio_below_zero, oemof_results, boolean_test) else: pass @@ -419,7 +419,7 @@ def hybrid_test(case_dict, oemof_results, experiment, e_flows_df): ], index=demand_profile.index, ) - ratio_below_zero = ratio.clip_upper(0) + ratio_below_zero = ratio.clip(upper=0) test_warning(ratio_below_zero, oemof_results, boolean_test) else: @@ -534,7 +534,7 @@ def usage_test(case_dict, oemof_results, experiment, e_flows_df): ], index=demand_profile.index, ) - ratio_below_zero = ratio.clip_upper(0) + ratio_below_zero = ratio.clip(upper=0) test_warning(ratio_below_zero, oemof_results, boolean_test) else: pass From 402ca4861cb849c5ee018ca223798e8034465f11 Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Sun, 3 Apr 2022 23:20:36 +0200 Subject: [PATCH 6/7] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 298932b..929f19f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,8 @@ Here is a template for new release sections - Moved `main()` from `Offgridders.py` to new file `src/cli.py` (#150) - Enable benchmark tests for Offgridders: Add optional argument `input_file` to `main()` (#150) - Added `GENSET_HOURS_OF_OPERATION` in `C1.overall_results_title` (#153) - +- Updated 'requirements.txt' (#164, #167) +- Fix deprecation warnings for pandas (#167) ### Removed - From 6196c15d2a021d791cf4818893cc25c4edb95b0b Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Tue, 16 Jul 2024 16:23:53 +0200 Subject: [PATCH 7/7] Replace pandas deprecated clip_lower by clip(lower= --- src/D0_process_input.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/D0_process_input.py b/src/D0_process_input.py index 472f654..faa9226 100644 --- a/src/D0_process_input.py +++ b/src/D0_process_input.py @@ -615,4 +615,4 @@ def randomized(white_noise_percentage, data_subframe): for i in range(0, len(data_subframe)): if data_subframe[i] != 0: data_subframe[i] = data_subframe[i] * (1 - noise[i]) - return data_subframe.clip_lower(0) # do not allow values <0 + return data_subframe.clip(lower=0) # do not allow values <0