home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 733235217

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/4600#issuecomment-733235217 https://api.github.com/repos/pydata/xarray/issues/4600 733235217 MDEyOklzc3VlQ29tbWVudDczMzIzNTIxNw== 10194086 2020-11-24T21:10:16Z 2020-11-24T21:10:16Z MEMBER

Good catch! If you haven't lost patience, there are two more things that leave open figures: test_plot_transposed_nondim_coord and some of the tests in TestDiscreteColorMap.

  1. To fix the first both of these lines need to be enclosed in a figure_context (each line separately):

https://github.com/pydata/xarray/blob/f1e2f9d510a63480f4dd7917083cd982ac4d451d/xarray/tests/test_plot.py#L2431-L2432

  1. To fix the second you can add the following code

python yield # Remove all matplotlib figures plt.close("all") after the following line:

https://github.com/pydata/xarray/blob/f1e2f9d510a63480f4dd7917083cd982ac4d451d/xarray/tests/test_plot.py#L964

And you should give yourselves credit in what's new. That's now more than a one-liner ;-)


Just as an addendum. The figures in the PlotTestCase class are autoclosed by

https://github.com/pydata/xarray/blob/f1e2f9d510a63480f4dd7917083cd982ac4d451d/xarray/tests/test_plot.py#L128-L133

but only if no more than one figure is opened per method.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  748379763
Powered by Datasette · Queries took 0.829ms · About: xarray-datasette