Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #374

Closed
rouille opened this issue Sep 14, 2022 · 0 comments · Fixed by #375
Closed

Fix warnings #374

rouille opened this issue Sep 14, 2022 · 0 comments · Fixed by #375
Assignees

Comments

@rouille
Copy link
Collaborator

rouille commented Sep 14, 2022

The following warnings are printed when running tests:

postreise/plot/tests/test_plot_capacity_map.py::test_map_plant_capacity
postreise/plot/tests/test_plot_capacity_map.py::test_map_plant_capacity
postreise/plot/tests/test_plot_capacity_map.py::test_map_plant_capacity
  /Users/brdo/CEM/PostREISE/.tox/pytest/lib/python3.9/site-packages/bokeh/models/plots.py:815: UserWarning: 
  You are attempting to set `plot.legend.label_text_font_size` on a plot that has zero legends added, this will have no effect.
  
  Before legend properties can be set, you must add a Legend explicitly, or call a glyph method with a legend parameter set.
  
    warnings.warn(_LEGEND_EMPTY_WARNING % attr)

postreise/plot/tests/test_plot_capacity_map.py::test_map_plant_capacity
postreise/plot/tests/test_plot_capacity_map.py::test_map_plant_capacity
postreise/plot/tests/test_plot_capacity_map.py::test_map_plant_capacity
  /Users/brdo/CEM/PostREISE/.tox/pytest/lib/python3.9/site-packages/bokeh/models/plots.py:815: UserWarning: 
  You are attempting to set `plot.legend.location` on a plot that has zero legends added, this will have no effect.
  
  Before legend properties can be set, you must add a Legend explicitly, or call a glyph method with a legend parameter set.
  
    warnings.warn(_LEGEND_EMPTY_WARNING % attr)

postreise/plot/tests/test_plot_scatter_capacity_vs_curtailment.py::test_plot_scatter_capacity_vs_curtailment
postreise/plot/tests/test_plot_scatter_capacity_vs_curtailment.py::test_plot_scatter_capacity_vs_curtailment
  /Users/brdo/CEM/PostREISE/postreise/plot/plot_scatter_capacity_vs_curtailment.py:87: FutureWarning: Passing a set as an indexer is deprecated and will raise in a future version. Use a list instead.
    curtailment = curtailment[set(plant_list) & set(curtailment.columns)]

postreise/plot/tests/test_plot_scatter_capacity_vs_curtailment.py::test_plot_scatter_capacity_vs_curtailment
  /Users/brdo/CEM/PostREISE/postreise/plot/plot_scatter_capacity_vs_curtailment.py:114: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
    _, ax = plt.subplots(figsize=[20, 10])

The last one needs attention. We need to close the plots in each testing module.

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 a pull request may close this issue.

1 participant