Deltares / xugrid

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

`grid.attrs` should return a copy, not a reference #272

Closed Huite closed 3 months ago

Huite commented 3 months ago

It currently looks like this:

    @property
    def attrs(self):
        return self._attrs

This means you can't set it (which you really wouldn't want to do; it'll break all bunch of relationships). But you can accidentally muck it up. The property should return a (deep)copy instead.