Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.

Commit f6c3e06

Browse files
committed
define __slots__
1 parent 9a6f674 commit f6c3e06

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

datatree/datatree.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ class DatasetView(Dataset):
101101

102102
# TODO what happens if user alters (in-place) a DataArray they extracted from this object?
103103

104+
__slots__ = (
105+
"_attrs",
106+
"_cache",
107+
"_coord_names",
108+
"_dims",
109+
"_encoding",
110+
"_close",
111+
"_indexes",
112+
"_variables",
113+
"__weakref__",
114+
)
115+
104116
def __init__(
105117
self,
106118
data_vars: Mapping[Any, Any] = None,
@@ -264,6 +276,17 @@ class DataTree(
264276
_indexes: Dict[Hashable, Index]
265277
_variables: Dict[Hashable, Variable]
266278

279+
__slots__ = (
280+
"_attrs",
281+
"_cache",
282+
"_coord_names",
283+
"_dims",
284+
"_encoding",
285+
"_close",
286+
"_indexes",
287+
"_variables",
288+
)
289+
267290
def __init__(
268291
self,
269292
data: Dataset | DataArray = None,

0 commit comments

Comments
 (0)