modex-flexmex / oemof-flexmex

oemof-flexmex is an oemof model built for model comparison within the Modex project FlexMex.
https://oemof-flexmex.readthedocs.io
MIT License
0 stars 0 forks source link

Features/dispatch plots #163

Closed jnnr closed 2 years ago

jnnr commented 3 years ago

This PR integrates the dispatch plots developed in oemoflex into the processing pipeline. I tested it for FlexMex2_1a

Can you test this for FlexMex2_2a,b,c,d as well, @monika-o? Probably you will have to adapt the plot_labels.yaml and plot_colors.csv.

monika-o commented 3 years ago

I've adjusted the labels and colors as well as the carrier name and tested the plots for FlexMex2_1a to d and FlexMex2_2a to d. They all worked. But we also need to update the plots function in oemoflex to add the different electricity demands together.

monika-o commented 3 years ago

@jnnr I have committed all my changes and tested the dispatch plots for FlexMex2_1a and for FlexMex2_2d. Everything works fine for me. If you wish, you can now check it again.

jnnr commented 3 years ago

Thanks for updating, @monika-o! I tested it and got a lot of nice plots. Above are some suggestions for improvement.

Also, I get this warning. Do you get the same. If so, can you find out how to fix that?

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.6/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "/usr/lib/python3.6/tkinter/__init__.py", line 749, in callit
    func(*args)
  File "python3.6/site-packages/matplotlib/backends/_backend_tk.py", line 253, in idle_draw
    self.draw()
  File "python3.6/site-packages/matplotlib/backends/backend_tkagg.py", line 9, in draw
    super(FigureCanvasTkAgg, self).draw()
  File "python3.6/site-packages/matplotlib/backends/backend_agg.py", line 407, in draw
    self.figure.draw(self.renderer)
  File "python3.6/site-packages/matplotlib/backend_bases.py", line 1544, in _draw
    def _draw(renderer): raise Done(renderer)
matplotlib.backend_bases._get_renderer.<locals>.Done: <matplotlib.backends.backend_agg.RendererAgg object at 0x7f6fdc5a5ef0>
monika-o commented 3 years ago

The issue with ktinker is an issue in matplotlib version 3.3.4, which is the version we use and also the latest that I can install with pip. According to https://github.com/matplotlib/matplotlib/issues/20204, the issue is now fixed, at least in the pre-release of version 3.5.0.

jnnr commented 3 years ago

The issue with ktinker is an issue in matplotlib version 3.3.4, which is the version we use and also the latest that I can install with pip. According to matplotlib/matplotlib#20204, the issue is now fixed, at least in the pre-release of version 3.5.0.

Ok, let us ignore the warning for now - as soon as the new version of matplotlib is released, it should not appear any more.

monika-o commented 3 years ago

I have realized your suggestions. You can now check it once again if you like.

monika-o commented 3 years ago

@jnnr I am now done again. I have also tested it with the new processed data and it works both for FlexMex2_1 and FlexMex2_2 (I have tested the first expansion step for both).

jnnr commented 3 years ago

The flake8 checks are failing again because the comparison with True was reset to == True in dev. This is necessary because the comparison with numpy.bool would return False otherwise. Can you please tell flake8 to ignore the specific lines, @monika-o?

jnnr commented 3 years ago

I just noticed that the units seem to be wrong. What is declared as MW in the dispatch plots should be GW. Please check that and correct it, @monika-o.

monika-o commented 2 years ago

@jnnr Unfortunately, I still couldn't solve the problem with flake8. Locally, flake8 accepted the noqa command behind the closing bracket and ignored the error, but apparently this does not work here on github. This is despite the version of flake8 being the same on my computer and here (4.0.1). According to this issue , it could be that noqa only works when it is in the same line as the code that produces the error (which would cause a conflict with black). But I could not test this because changing it, as you can see above, caused conflicts with the base branch, and therefore the tests didn't run anymore.