Skip to content

Add storage components to energy system components table in autoreport#686

Merged
smartie2076 merged 7 commits intodevfrom
fix/storage_in_autoreport
Dec 9, 2020
Merged

Add storage components to energy system components table in autoreport#686
smartie2076 merged 7 commits intodevfrom
fix/storage_in_autoreport

Conversation

@mahendrark
Copy link
Copy Markdown
Contributor

@mahendrark mahendrark commented Dec 7, 2020

Fix #682

Changes proposed in this pull request:

  • Add storage components to the dash table displaying the energy system components in the autoreport

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.

@mahendrark
Copy link
Copy Markdown
Contributor Author

mahendrark commented Dec 7, 2020

@smartie2076

can you check if it is working for you?

I get this error although the simulation runs successfully (and I do not have the storage assets displayed :/ but I am pretty confident that the code itself is alright):

ERROR-Energy system bus Electricity (DSO)_pdp_bus has too few assets connected to it. The minimal number of assets that need to be connected so that the bus is not a dead end should be two, excluding the excess sink. These are the connected assets: Electricity_grid_DSO_consumption

I tried adding a print statement in the function I modified, but strangely it does not print anything!

@smartie2076
Copy link
Copy Markdown
Collaborator

can you check if it is working for you?

Will do, but first I need to finish PR #685.

I get this error although the simulation runs successfully (and I do not have the storage assets displayed :/ but I am pretty confident that the code itself is alright):

ERROR-Energy system bus Electricity (DSO)_pdp_bus has too few assets connected to it. The minimal number of assets that need to be connected so that the bus is not a dead end should be two, excluding the excess sink. These are the connected assets: Electricity_grid_DSO_consumption

Actually, this error message is to be ignored right now. It is of no relevance for you (but yes, we should remove it at some point). Is there already an issue about that one? If not, can you create one so that I can explain what happens there and link it with the appropriate

I tried adding a print statement in the function I modified, but strangely it does not print anything!

I will check it out, not printing is weird. Your other changes do something, though, do they? I mean, if you print somewhere else (directly in mvs_tool.py), does it print?

@paragpatil39 This is a rather small PR, and I would like you to review it. Is there a changelog? Are there enough in-line-comments on what the code does with #?

@mahendrark
Copy link
Copy Markdown
Contributor Author

mahendrark commented Dec 7, 2020

@smartie2076

It is very weird indeed!
In fact I added print statements in E1 and F2, none of them print

I am using this command to run the simulation: mvs_tool -i tests/inputs -ext csv -f -pdf
and this: mvs_tool -i tests/benchmark_test_inputs/AFG_grid_heatpump_heat -ext csv -f -pdf

Update: Print statement in mvs_tool.py also does not print

@smartie2076
Copy link
Copy Markdown
Collaborator

@smartie2076

It is very weird indeed!
In fact I added print statements in E1 and F2, none of them print

I am using this command to run the simulation: mvs_tool -i tests/inputs -ext csv -f -pdf
and this: mvs_tool -i tests/benchmark_test_inputs/AFG_grid_heatpump_heat -ext csv -f -pdf

Update: Print statement in mvs_tool.py also does not print

Ah! Nope, that will not work. If you use the pip-installed package, you are working with the latest release version, not your local (and changed) MVS!

Try it once with python mvs_tool.py, and if that does not work, we can look at it together and delete all the work package files that hinder local code execution.

@mahendrark
Copy link
Copy Markdown
Contributor Author

mahendrark commented Dec 8, 2020

@smartie2076, thanks for the tip about running the tool as a dev. @paragpatil39, this PR is ready for review!

simulation_report.pdf

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.

Nice that you added the in-line comments :)

In the pdf you uploaded, actually only the batteries output power is added to the list of components:
grafik

However, this should be three assets:
grafik

I showed you in the comments where you need to adapt the code.

You should also make sure you run set EXECUTE_TESTS_ON=master and pytest tests. With more people to manage in this repo I will soon not accept PR that dont have that box ticked ;)

@mahendrark
Copy link
Copy Markdown
Contributor Author

@smartie2076

Fixed the table, now there should be all the storage components. I uploaded the PDF here.
I used constants everywhere.

One problem, the benchmark tests result in an error (below) for me. Google search did not help. I could not find a solution.

(mvspvcomp) (base) mr@nb-24admin:~/Projects/multi-vector-simulator$ EXECUTE_TESTS_ON=master pytest
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/mr/Projects/dev_envs/mvspvcomp/lib/python3.8/site-packages/_pytest/main.py", line 187, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/mr/Projects/dev_envs/mvspvcomp/lib/python3.8/site-packages/_pytest/config/__init__.py", line 820, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/home/mr/Projects/dev_envs/mvspvcomp/lib/python3.8/site-packages/pluggy/hooks.py", line 308, in call_historic
INTERNALERROR>     res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/home/mr/Projects/dev_envs/mvspvcomp/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/mr/Projects/dev_envs/mvspvcomp/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "/home/mr/Projects/dev_envs/mvspvcomp/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/home/mr/Projects/dev_envs/mvspvcomp/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/mr/Projects/dev_envs/mvspvcomp/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/mr/Projects/dev_envs/mvspvcomp/lib/python3.8/site-packages/pytest_sugar.py", line 176, in pytest_configure
INTERNALERROR>     sugar_reporter = SugarTerminalReporter(standard_reporter)
INTERNALERROR>   File "/home/mr/Projects/dev_envs/mvspvcomp/lib/python3.8/site-packages/pytest_sugar.py", line 214, in __init__
INTERNALERROR>     self.writer = self._tw
INTERNALERROR> AttributeError: can't set attribute

simulation_report.pdf

@smartie2076 smartie2076 mentioned this pull request Dec 8, 2020
@smartie2076
Copy link
Copy Markdown
Collaborator

One problem, the benchmark tests result in an error (below) for me. Google search did not help. I could not find a solution.

I will check locally what this is about.

simulation_report.pdf

Looking good now!

@smartie2076
Copy link
Copy Markdown
Collaborator

One problem, the benchmark tests result in an error (below) for me. Google search did not help. I could not find a solution.

I will check locally what this is about.

I did not get an error message for this. Might it be that the error is about side packages?

@mahendrark mahendrark force-pushed the fix/storage_in_autoreport branch from 507b19e to eb0668c Compare December 8, 2020 16:29
@mahendrark
Copy link
Copy Markdown
Contributor Author

One problem, the benchmark tests result in an error (below) for me. Google search did not help. I could not find a solution.

I will check locally what this is about.

I did not get an error message for this. Might it be that the error is about side packages?

I think so too..

I just rebased this branch.

@smartie2076
Copy link
Copy Markdown
Collaborator

I just rebased this branch.

Nice! I am waiting for Sabines release to go though before I merge dev into this one and then this one into dev. Might get messy otherwise.

@mahendrark mahendrark force-pushed the fix/storage_in_autoreport branch from eb0668c to cb3486e Compare December 8, 2020 20:23
@smartie2076 smartie2076 merged commit 6163f42 into dev Dec 9, 2020
@smartie2076 smartie2076 deleted the fix/storage_in_autoreport branch December 9, 2020 15:18
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.

[Bug][Automatic report] Storage not shown in table of energy system components

2 participants