Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update requirements.txt #167

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-

Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
27 changes: 11 additions & 16 deletions src/A1_general_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import pandas as pd
import numpy as np
from src.constants import (
CAPACITY_PV_KWP,
CAPACITY_WIND_KW,
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/D0_process_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/G2b_constraints_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down