-
Notifications
You must be signed in to change notification settings - Fork 10
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
Benchmark test for heat sector #524
Conversation
Hi @smartie2076 , I was thinking of integrating a time series for the electricity DSO in this benchmark test, so it would also look into #506 Why I am thinking about that, it's basically because in this simple test with electricity DSO, heat DSO and heat pump, the heat pump will only be used when electricity_price/COP < heat_price I am actually trying to implement it myself but I get this error: json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) |
or this could also be implemented as a sensitivity analysis @smartie2076 @Bachibouzouk |
@smartie2076 I have written the benchmark tests which are ready for review. Please let me know if we will include the time series here or not :) |
Hi Ursula! Actually, you should be able to implement a timeseriers with The idea is good! (readthedocs says |
Including the quotation marks! |
hi @smartie2076 , I tried both ways and the error is still the same: json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) .. I am not sure what the problem is.. |
Okay, please push with the input files and I look into it tomorrow. |
The dict has to be defined using string delimiter A new error occurs now with the function
It might be that this only works for mixed problems (one series, one scalar) if the scalar is of type int. Please check if it can be float (because it will most likely be a float). Maybe use pd.multiply or something then. |
Co-authored-by: Pierre Francois <pierre-francois.duc@rl-institut.de>
hi @smartie2076 for provider in dict_values[ENERGY_PROVIDERS].keys():
feedin_tariff = dict_values[ENERGY_PROVIDERS][provider][FEEDIN_TARIFF]
electricity_price = dict_values[ENERGY_PROVIDERS][provider][ENERGY_PRICE]
if "value" in feedin_tariff and "value" in electricity_price:
diff = feedin_tariff["value"] - electricity_price["value"]
if diff > 0:
msg = f"Feed-in tariff > energy price of energy provider asset '{dict_values[ENERGY_PROVIDERS][provider][LABEL]}' would cause an unbound solution and terminate the optimization."
raise ValueError(msg)
elif "value" in feedin_tariff and "flow" in electricity_price:
for i in range(0, electricity_price["flow"]["data"]):
diff[i] = feedin_tariff["value"] - electricity_price["flow"]["data"][i]
if any(diff) > 0:
msg = f"Feed-in tariff > energy price of energy provider asset '{dict_values[ENERGY_PROVIDERS][provider][LABEL]}' would cause an unbound solution and terminate the optimization."
raise ValueError(msg) |
@ursulaelmir if you set the code between ```python and ``` |
Yeah, something like that! Please always use global variables: for provider in dict_values[ENERGY_PROVIDERS].keys():
feedin_tariff = dict_values[ENERGY_PROVIDERS][provider][FEEDIN_TARIFF]
electricity_price = dict_values[ENERGY_PROVIDERS][provider][ENERGY_PRICE]
if VALUE in feedin_tariff and VALUE in electricity_price:
diff = feedin_tariff[VALUE] - electricity_price[VALUE]
if diff > 0:
msg = f"Feed-in tariff > energy price for the energy provider asset '{dict_values[ENERGY_PROVIDERS][provider][LABEL]}' would cause an unbound solution and terminate the optimization. Please reconsider your feed-in tariff and energy price."
raise ValueError(msg)
else:
diff = feedin_tariff - electricity_price
boolean = [k > 0 for k in diff.values] # True if there is an instance where feedin tarrif > electricity_price
if any(boolean) == True:
instances = sum(boolean) # Count instances
msg = f"Feed-in tariff > energy price in {instances} during the simulation time for the energy provider asset '{dict_values[ENERGY_PROVIDERS][provider][LABEL]}'. This would cause an unbound solution and terminate the optimization. Please reconsider your feed-in tariff and energy price."
raise ValueError(msg) |
at the moment there's a keyError 0 and when I print electricity price, it's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, nice that we have the feature of energy price tariffs tested now as well, combined with the electricity sector.
I would propose though that we split the benchmark tests into multiple files: By now I wonder what "simple_scenarios" are. I think a sector coupling example is not necessarily a simple scenario.
Also, we should add docstrings to our benchmark tests, so that we know what they are about and how we might have to fix them.
Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com>
Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com>
Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com>
Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com>
I view the name "simple scenario" as "the simplest possible case of sector coupling". Even though sector coupling might be considered more complicated than just PV + battery. |
@smartie2076 I added some definitions for the benchmark tests and removed the word "simple" for now. Is this okay? |
Hm, but the file includes all benchmark tests for the electricity sector (#106), as well as for the heat sector - basically sector-coupled cases - (#503), and also peak demand pricing... I probably understand it better if we have following benchmark test groups in seperate files:
...@Bachibouzouk are these too many files? I am a bit peculiar in organising my files, so I am not sure. |
I don't think it is too many files, it is fine :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two suggestions, otherwise ready to merge!
We can rename the benchmark tests according to my suggestions in another PR. :)
Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com>
Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com>
@smartie2076 there is an error I think related to merging dev into this branch. am I missing something? |
Have you added the required file
|
THANKS! |
Fix #503
Changes proposed in this pull request:
The following steps were realized, as well (if applies):
black . --exclude docs/
)EXECUTE_TESTS_ON=master pytest
)Please mark above checkboxes as following:
❌ Check not applicable to this PR
For more information on how to contribute check the CONTRIBUTING.md.