home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 371718795

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/1972#issuecomment-371718795 https://api.github.com/repos/pydata/xarray/issues/1972 371718795 MDEyOklzc3VlQ29tbWVudDM3MTcxODc5NQ== 1562854 2018-03-09T05:38:23Z 2018-03-09T05:38:23Z CONTRIBUTOR

As pointed out on the matplotlib gitter:

If you run

```python import numpy as np import xarray as xr import matplotlib.pyplot as plt

for i in range(200): xr.DataArray(np.array([[0, 0], [0, 0]], dtype=np.uint8)).plot.pcolormesh() at step 165 you will get: File "/Users/jklymak/matplotlib/lib/matplotlib/figure.py", line 236, in update raise ValueError('left cannot be >= right') ValueError: left cannot be >= right ``` Why? Because you have made a plot that if it displays looks like:

Are you sure your test isn't doing something similar? At some point there just isn't room for more colorbars! Adding a plt.clf() can cure the problem.

Its also is possible you are hitting floating point overflows with your test. At some point Matplotlib needs to be able to manipulate the data that comes in, and if you operate near the maximum number your data type can handle, you'll have problems. Just like you would if you just did

python a = 2*xr.DataArray(np.array([[0, 0], [0, 1e308]])) you will get: /Users/jklymak/anaconda3/envs/matplotlibdev/lib/python3.6/site-packages/xarray/core/variable.py:1165: RuntimeWarning: overflow encountered in multiply So maybe your hypothesis tester could be constrained to stay away from floating point overflows?

Matplotlib indeed has flaws and quirks, but if you are finding bugs it would be good to isolate them.

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