rl-institut / multi-vector-simulator

Multi-vector Simulation Tool assessing and optimizing Local Energy Systems (LES) for the E-LAND project
GNU General Public License v2.0
21 stars 10 forks source link

[Bug] F1 module prevent the simulation to run smoothly #285

Closed Bachibouzouk closed 4 years ago

Bachibouzouk commented 4 years ago

Here is the error message running pytest tests/test_benchmark.py and this only concern the test of the json file, the test using csv as input works fine. So it is probably something missing within the json file.

23:46:57-INFO-Creating pie-chart for total annuity (minor)
Traceback (most recent call last):
  File "mvs_tool.py", line 4, in <module>
    main()
  File "/home/pfduc/Documents/RLI/mvs_eland/mvs_eland_tool/mvs_eland_tool.py", line 154, in main
    output_processing.evaluate_dict(dict_values)
  File "/home/pfduc/Documents/RLI/mvs_eland/src/F0_output.py", line 101, in evaluate_dict
    plot_piecharts_of_costs(dict_values)
  File "/home/pfduc/Documents/RLI/mvs_eland/src/F0_output.py", line 122, in plot_piecharts_of_costs
    F1_plots.evaluate_cost_parameter(dict_values, "annuity_total", "annuity")
  File "/home/pfduc/Documents/RLI/mvs_eland/src/F1_plotting.py", line 245, in evaluate_cost_parameter
    title,
  File "/home/pfduc/Documents/RLI/mvs_eland/src/F1_plotting.py", line 374, in plot_a_piechart
    title=title, autopct="%1.1f%%", subplots=True,
  File "/home/pfduc/.virtualenvs/mvs-test-f2/lib/python3.6/site-packages/pandas/plotting/_core.py", line 2909, in pie
    return self(kind='pie', **kwds)
  File "/home/pfduc/.virtualenvs/mvs-test-f2/lib/python3.6/site-packages/pandas/plotting/_core.py", line 2742, in __call__
    **kwds)
  File "/home/pfduc/.virtualenvs/mvs-test-f2/lib/python3.6/site-packages/pandas/plotting/_core.py", line 1998, in plot_series
    **kwds)
  File "/home/pfduc/.virtualenvs/mvs-test-f2/lib/python3.6/site-packages/pandas/plotting/_core.py", line 1801, in _plot
    plot_obj.generate()
  File "/home/pfduc/.virtualenvs/mvs-test-f2/lib/python3.6/site-packages/pandas/plotting/_core.py", line 249, in generate
    self._compute_plot_data()
  File "/home/pfduc/.virtualenvs/mvs-test-f2/lib/python3.6/site-packages/pandas/plotting/_core.py", line 367, in _compute_plot_data
    'plot'.format(numeric_data.__class__.__name__))
TypeError: Empty 'DataFrame': no numeric data to plot

Checklist to make sure that the bug report ist complete:

Bachibouzouk commented 4 years ago

@smartie2076 - we forgot to run the pytest tests/test_benchmark.py locally :(

smartie2076 commented 4 years ago

This runs neither locally nor with travis, doesn´t it?

This should be related to #267, with a solution added by @Piranias in #230 or PR #235. Basically, a pie chart is about to be plotted but there is no data to use for it.

Bachibouzouk commented 4 years ago

Travis does not run these tests, because they take time. That is why it is up to the person doing the PR to run them locally (they only run when the test file is explicitely called, ie pytest tests/test_benchmark.py, when running just pytest they will be skipped)

smartie2076 commented 4 years ago

Oooohhh, good to know. Is there a way to ensure that the benchmark tests are always run when merging into master? That would be handy, wouldn´t it?

Bachibouzouk commented 4 years ago

Yes we can run specific tests depending on branch, need to look how but I know it is possible :)