Skip to content

adding KPI's DG, OEF and OEM#624

Merged
SabineHaas merged 43 commits intodevfrom
feature/add_KPIs2
Nov 11, 2020
Merged

adding KPI's DG, OEF and OEM#624
SabineHaas merged 43 commits intodevfrom
feature/add_KPIs2

Conversation

@Piranias
Copy link
Copy Markdown
Collaborator

@Piranias Piranias commented Oct 28, 2020

Fix #603

Changes proposed in this pull request:

  • in E3: added functions:
* add_degree_of_autonomy() and equation_degree_of_autonomy()
* add_onsite_energy_fraction() and equation_onsite_energy_fraction()
* add_add_add_onsite_energy_matching() and equation_onsite_energy_matching()
  • write tests for each function in Test_E3
  • add to changelog
  • added constants to constants_json_strings.py
  • added the three KPI functions to E0

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.

@Piranias Piranias changed the title Feature/add kp is2 adding KPI's DG, OEF and OEM Oct 28, 2020
@Piranias
Copy link
Copy Markdown
Collaborator Author

unfortunately I changed the branch too late, apparently I transferred changes from PR #609 (read the docs) to this PR without noticing.
This should be solved when PR #609 is merged..

@Piranias Piranias requested a review from SabineHaas October 28, 2020 15:58
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.

Thank you @Piranias for adding these KPIs.

I requested some changes and here are my general comments:

  • I would add a section "Notes" before the "Returns" section and move the formulas to "Notes".
  • Please add the test function names (see #todo TEST)
  • I don't see how you added weighting in the calculation of the KPIs.
  • @Smarties would ask you for assertion messages, see E2 tests for examples

@Piranias
Copy link
Copy Markdown
Collaborator Author

Piranias commented Nov 3, 2020

Thank you @Piranias for adding these KPIs.

I requested some changes and here are my general comments:

* I would add a section "Notes" before the "Returns" section and move the formulas to "Notes".

I adjusted the style of the functions to all the other functions in this module. I would not change the styling of single functions now.

* Please add the test function names (see #todo TEST)

done

* I don't see how you added weighting in the calculation of the KPIs.

I did not add weighting in the functions but I used the "total_flow_of_energy_conversion_equivalent " which should already contain the weighting. But I'm not 100% sure if I added all the flows correctly, let's wait for @smartie2076 ti check this!

* @Smarties would ask you for assertion messages, see E2 tests for examples

done

@Piranias Piranias requested a review from smartie2076 November 3, 2020 12:28
Copy link
Copy Markdown
Collaborator

@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.

Yay, three more KPI!

I think a change is necessary for the feedin calculation.

Also, regarding the tests - I think you only wrote some for the equations, not the add_xy functions?

I see in the tests for the equations that you tested for one example, but not for the extreme values (can autonomy be > 1? What if excessive local generation but also excess for oem?

Copy link
Copy Markdown
Collaborator

@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.

Looking good!

@Piranias
Copy link
Copy Markdown
Collaborator Author

Yay, three more KPI!

I think a change is necessary for the feedin calculation.

Also, regarding the tests - I think you only wrote some for the equations, not the add_xy functions?

I added the missing tests now!

I see in the tests for the equations that you tested for one example, but not for the extreme values (can autonomy be > 1? What if excessive local generation but also excess for oem?

The degree of autonomy can be > 1. See https://mvs-eland.readthedocs.io/en/latest/MVS_Outputs.html#degree-of-autonomy-da

the OEM cannot be > 1. But this is due to the simulation, I wouldn't know how to test this. For an explanation see: https://mvs-eland.readthedocs.io/en/latest/MVS_Outputs.html#onsite-energy-matching-oem

@SabineHaas SabineHaas self-requested a review November 11, 2020 10:06
@SabineHaas SabineHaas merged commit b74e2c0 into dev Nov 11, 2020
@SabineHaas SabineHaas deleted the feature/add_KPIs2 branch November 11, 2020 10:06
smartie2076 added a commit that referenced this pull request Nov 11, 2020
@Bachibouzouk
Copy link
Copy Markdown
Collaborator

* Check if benchmark tests pass locally (`EXECUTE_TESTS_ON=master pytest`)

@Piranias - did you really run the EXECUTE_TESTS_ON=master pytest locally?

I found errors when I did

@smartie2076 smartie2076 mentioned this pull request Nov 11, 2020
@Piranias
Copy link
Copy Markdown
Collaborator Author

* Check if benchmark tests pass locally (`EXECUTE_TESTS_ON=master pytest`)

@Piranias - did you really run the EXECUTE_TESTS_ON=master pytest locally?

I found errors when I did

ahh, I did before but forgot to run it again after adding the tests :( sorry. Did you work i out yet, or should I ?

@Bachibouzouk
Copy link
Copy Markdown
Collaborator

I fixed it in ced0b21, before we get our CI fixed, make sure you run the tests before you ask for review :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementation of Self-sufficiency & self-consumption (nicht bilanziell)

4 participants