MCPcopy Index your code
hub / github.com/pydata/xarray / assert_writeable

Function assert_writeable

xarray/tests/__init__.py:60–70  ·  view source on GitHub ↗
(ds)

Source from the content-addressed store, hash-verified

58
59
60def assert_writeable(ds):
61 readonly = [
62 name
63 for name, var in ds.variables.items()
64 if not isinstance(var, IndexVariable)
65 and not isinstance(
66 var.data, PandasExtensionArray | pd.api.extensions.ExtensionArray
67 )
68 and not var.data.flags.writeable
69 ]
70 assert not readonly, readonly
71
72
73def _importorskip(

Callers 3

create_append_test_dataFunction · 0.90
make_datasetsFunction · 0.90
create_test_dataFunction · 0.85

Calls 1

itemsMethod · 0.80

Tested by 2

create_append_test_dataFunction · 0.72
make_datasetsFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…