Deltares / xugrid

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

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

Closed Huite closed 1 month ago

Huite commented 1 month 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.