Deltares / xugrid

Xarray and unstructured grids
https://deltares.github.io/xugrid/
MIT License
58 stars 8 forks source link

New xarray release breaks xugrid due to changes in xarray plot utils #162

Closed Huite closed 11 months ago

Huite commented 11 months ago

Importing xugrid with the latest xarray results in:

ImportError: cannot import name 'import_matplotlib_pyplot' from 'xarray.plot.utils

Likely a namespace or something in xarray has changed. Since these are internal methods really, we should arguably just copy them into xugrid.

veenstrajelmer commented 11 months ago

up to xarray 2023.8.0 they had the following function: https://github.com/pydata/xarray/blob/83c2919b27b4b2d8a01bfa380226134c71321aa0/xarray/plot/utils.py#L50-L55

This can easily be replaced by the contents: import matplotlib.pyplot as plt