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 raised by tests #375

Merged
merged 3 commits into from
Sep 14, 2022
Merged

Fix warnings raised by tests #375

merged 3 commits into from
Sep 14, 2022

Conversation

rouille
Copy link
Collaborator

@rouille rouille commented Sep 14, 2022

Pull Request doc

Purpose

Fix warnings. There are three kinds of warnings

  • one raised by pandas regarding the type of array used for indexing a data frame
  • one raised by bokeh because we attempt to edit an empty legend
  • one raised by matplotlib because too many figures have been opened

Closes #374.

What the code is doing

  • Use a list in place of a set to index data frame in plot_scatter_capacity_vs_curtailment
  • Use only coal generator to ensure glyphs are rendered on the map and legend is created in test_plot_capacity_map
  • Close all plots in each test module where plots are generated

Testing

Warnings are not raised

Where to look

Changes are mostly done in the test modules

Usage Example/Visuals

N/A

Time estimate

5min

@rouille rouille self-assigned this Sep 14, 2022
@jenhagg
Copy link
Collaborator

jenhagg commented Sep 14, 2022

We can also use a fixture to close the plot automatically after each test (I wasn't sure so tried it out in this branch)

@BainanXia
Copy link
Collaborator

We can also use a fixture to close the plot automatically after each test (I wasn't sure so tried it out in this branch)

That's smart.

@rouille
Copy link
Collaborator Author

rouille commented Sep 14, 2022

We can also use a fixture to close the plot automatically after each test (I wasn't sure so tried it out in this branch)

That's smart.

Much cleaner. I will cherry pick your commit and update the PR

@rouille
Copy link
Collaborator Author

rouille commented Sep 14, 2022

We can also use a fixture to close the plot automatically after each test (I wasn't sure so tried it out in this branch)

That's smart.

Much cleaner. I will cherry pick your commit and update the PR

Done

@rouille rouille merged commit 81e0081 into develop Sep 14, 2022
@rouille rouille deleted the ben/warnings branch September 14, 2022 19:19
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.

Fix warnings
3 participants