Skip to content

Feature/minimal degree of autonomy#726

Merged
smartie2076 merged 19 commits intodevfrom
feature/minimal_degree_of_autonomy
Jan 27, 2021
Merged

Feature/minimal degree of autonomy#726
smartie2076 merged 19 commits intodevfrom
feature/minimal_degree_of_autonomy

Conversation

@smartie2076
Copy link
Copy Markdown
Collaborator

@smartie2076 smartie2076 commented Dec 16, 2020

Fix #721

Changes proposed in this pull request:

  • Add section on constraint in RTD
  • Change description of DOA in RTD (@TheOneAndra please create a PR into this branch)
  • Change definition of DOA in E3 indicator calculation
  • Add pytest for changed DOA
  • Add D2.constraint_minimal_degree_of_autonomy()
  • Add pytest for D2.constraint_minimal_degree_of_autonomy(), specifically only for D2.prepare_constraint_minimal_degree_of_autonomy. See Add tests for adding minimal_renewable_share #742 if this is also possible for the general function.
  • Add E4.minimal_degree_of_autonomy()
  • Add pytest for E4.minimal_degree_of_autonomy()
  • Add bechmark test
  • Change all input and json files so that they have the new parameter
  • Change parser

The following steps were realized, as well (if applies):

  • Use in-line comments to explain your code
  • Write docstrings to your code (example docstring)
  • For new functionalities: Explain in readthedocs
  • Write test(s) for your new patch of code (pytests, assertion debug messages)
  • Update the CHANGELOG.md
  • Apply black (black . --exclude docs/)
  • Check if benchmark tests pass locally (EXECUTE_TESTS_ON=master pytest)

Please mark above checkboxes as following:

  • Open
  • Done

❌ Check not applicable to this PR

For more information on how to contribute check the CONTRIBUTING.md.

@smartie2076 smartie2076 added the enhancement New feature or request label Dec 16, 2020
@smartie2076
Copy link
Copy Markdown
Collaborator Author

@TheOneAndra can you check the description of the feature in the RTD? To make sure we are on the same page. Also, please create a PR into this one to adapt the DOA definition in the RTD to our current one.

@smartie2076
Copy link
Copy Markdown
Collaborator Author

@SabineHaas you can also look at this PR, if you are interested. Not done, though.
@TheOneAndra you can pull this branch and check out the feature.

@smartie2076 smartie2076 force-pushed the feature/minimal_degree_of_autonomy branch from 1c527a6 to bd48576 Compare December 16, 2020 17:32
@TheOneAndra
Copy link
Copy Markdown
Collaborator

@TheOneAndra can you check the description of the feature in the RTD? To make sure we are on the same page. Also, please create a PR into this one to adapt the DOA definition in the RTD to our current one.

Check PR #730

Copy link
Copy Markdown
Collaborator

@TheOneAndra TheOneAndra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that an underlined condition of this new constraint is that optimizeCap for the energyProviders.csv should be True ? If so, it should be specified.

And what about the transformer station in energyConversion.csv

@TheOneAndra
Copy link
Copy Markdown
Collaborator

The minimal degree of autonomy is applied to the whole, sector-coupled energy system

So for now one cannot simulate two energy providers with different minimal_DA. This would be an interesting disctinction for energy cells. I added that comment in issue #721

@mahendrark mahendrark force-pushed the feature/minimal_degree_of_autonomy branch 2 times, most recently from e674bfe to 834c8cd Compare December 17, 2020 08:58
@mahendrark
Copy link
Copy Markdown
Contributor

mahendrark commented Dec 17, 2020

I did some housekeeping here :)
Rebased, and now it has cleaner commit history, following @Bachibouzouk's advice to me long back regarding solving merge conflicts

@smartie2076 @TheOneAndra please do a git pull before working on this branch!

@smartie2076 smartie2076 mentioned this pull request Dec 17, 2020
4 tasks
@smartie2076
Copy link
Copy Markdown
Collaborator Author

I did some housekeeping here :)
Rebased, and now it has cleaner commit history, following @Bachibouzouk's advice to me long back regarding solving merge conflicts

@smartie2076 @TheOneAndra please do a git pull before working on this branch!

Hi @mahendrark! I appreciate the housekeeping, but especially for force-push please talk to the PR owner first! I will explain my reasons bilaterally :)

@Bachibouzouk
Copy link
Copy Markdown
Collaborator

Bachibouzouk commented Jan 4, 2021

Rebased, and now it has cleaner commit history, following @Bachibouzouk's advice to me long back regarding solving merge conflicts

@mahendrark, I am pretty sure I was refering to rebasing on your own branch, when you are sure no one else works on it ...

@smartie2076 smartie2076 mentioned this pull request Jan 7, 2021
11 tasks
Copy link
Copy Markdown
Collaborator

@TheOneAndra TheOneAndra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smartie2076 Here are the changes we discussed together.

@smartie2076 smartie2076 force-pushed the feature/minimal_degree_of_autonomy branch from 452a05f to 7e89a14 Compare January 20, 2021 12:43
@smartie2076 smartie2076 marked this pull request as ready for review January 20, 2021 12:47
Copy link
Copy Markdown
Contributor

@SabineHaas SabineHaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this was a big PR @smartie2076 ! :D but nice features!
general comments:

  • you could add tests for E3 functions
  • solve merge conflict (you already told me that this is on your list)

I actually liked the old definition of DoA, which was in other words a "degree of Net Zero Energy", as we need this for pvcompare.
It would be nice if we could preserve the KPI, i.e. the old definition of DoA (functions were all there) and just rename it to "degree of net zero energy". What do you think?

This was linked to issues Jan 26, 2021
@SabineHaas SabineHaas mentioned this pull request Jan 26, 2021
4 tasks
Copy link
Copy Markdown
Collaborator Author

@smartie2076 smartie2076 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, that wasnt too much change :D

smartie2076 and others added 16 commits January 27, 2021 15:36
- Update definition of degree of autonomy and change equation: Now based
on demand and consumption from energy provider only
- Add parameter `minimal_degree_of_autonomy` into
`MVS_parameters_list.csv` and reference it
- Add description of minimal degree of autonomy constraint
- Add `TOTAL_CONSUMPTION_FROM_PROVIDERS` to `constants_json_strings.py`

- Missing: add_total_consumption_electricity_equivalent()
- Change constants in `E3.add_total_feedin_electricity_equivaluent` so
that they are logical
- Refactor  `E3.add_total_feedin_electricity_equivaluent` to
`E3.add_total_feedin_electricity_equivaluent`
- Add `MINIMAL_DEGREE_OF_AUTONOMY` to `constants_json_strings.py`
- Add `MINIMAL_DEGREE_OF_AUTONOMY` to `KNOWN_EXTRA_PARAMETERS` in
`constants.py`
- Change `D2.add_constraints` to call new constraint
- Add `D2.constraint_minimal_degree_of_autonomy` with processing
function `D2.prepare_constraint_minimal_degree_of_autonomy`
- Add pytest for `D2.prepare_constraint_minimal_degree_of_autonomy`
- Missing: Test for `D2.constraint_minimal_degree_of_autonomy` ->
@mahendrak?
- Update `input_template`
- Update all files `constraints.csv` in `tests/benchmark_test_inputs`
- Update `tests/test_data/inputs_for_E1/csv_elements/constraints.csv`
- Update `tests/inputs/constraints.csv`, and adapt `maximum_emissions`
so that both constraints can coexist
- Update `tests/inputs/mvs_config.json` with the `json_processed.json`
from the `test/inputs` folder
- Update json files for D0 and D1 tests:
`test/test_data/inputs_for_D0/mvs_config.json` and
`test/test_data/inputs_for_D1/mvs_config.json`
- Now based on demand and consumption from energy provider (see RTD)
- Added pytest for functions
- Generalize `E4.minimal_renewable_share_test` to
`E4.minimal_constraint_test`
- Test both minimal renewable share as well as minimal degree of
autonomy with that function
- Update pytest for generic function
- Verification applied not only to renewable assets, but specifically to
dispatchable assets (otherwise there is an error message with the
`mvs_config.json` file, as the automatically defined DSO consumption
source does not have the parameter `renewableAsset`
- Adapt pytest
- Add benchmark test, analogeous to benchmark test for minimal renewable
share constraint
- Add input files for a case with 0% minimal degree of autonomy and one
with 70% minimal degree of autonomy
- Fix RTD math environment
- Remove unnecessary code (for `E4.maximum_emissions_test`)
- Add instructions for pytest for model constraints introduced in `D2`
- Remove automatically generated assets (excess, feedin) from energyConsumption in `mvs_config.json` files, as they do not have a `dsm` nor `type_asset` parameter, resulting in an error. Created issue for permanent fix
- Take new minimal DOA constraint into account for `D2` pytests
…ider:

- Refactor `E3.add_total_consumption_electricity_equivaluent()` to `E3.add_total_consumption_from_provider_electricity_equivalent()`
- Add pytest
- Update changelog accordingly
@smartie2076 smartie2076 force-pushed the feature/minimal_degree_of_autonomy branch from d8e0814 to e6862a8 Compare January 27, 2021 14:41
@smartie2076
Copy link
Copy Markdown
Collaborator Author

@SabineHaas: I think I am done (also added a pytest for E3), and when the tests ran though I can merge.

@TheOneAndra: The branch does calculate the consumption from energy providers, and places the info into the KPI_SCALARS.

@Bachibouzouk added MINIMAL_DEGREE_OF_AUTONOMY to the EPA-MVS parser, so that should work allright.

@SabineHaas SabineHaas mentioned this pull request Jan 27, 2021
12 tasks
Co-authored-by: Sabine Haas <[email protected]>
@smartie2076 smartie2076 merged commit 903943a into dev Jan 27, 2021
@smartie2076 smartie2076 deleted the feature/minimal_degree_of_autonomy branch January 27, 2021 16:34
@smartie2076 smartie2076 restored the feature/minimal_degree_of_autonomy branch January 27, 2021 16:34
MaGering added a commit that referenced this pull request Jan 28, 2021
@smartie2076 smartie2076 deleted the feature/minimal_degree_of_autonomy branch March 11, 2022 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected constraint min DOA Net Zero Energy KPI DA as constraint

5 participants