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 - diff --git a/requirements.txt b/requirements.txt index 2deeb8b..c199bef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ -matplotlib==3.0.0 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 \ No newline at end of file diff --git a/src/A1_general_functions.py b/src/A1_general_functions.py index 50250aa..d95f69d 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,39 +104,33 @@ 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) 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 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 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