Skip to content

Commit 2e39ddd

Browse files
committed
doco
1 parent 68cd799 commit 2e39ddd

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

zarr/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def _chunk_setitem(self, cidx, key, value):
223223
Value to set.
224224
225225
"""
226-
226+
227227
# override this in sub-classes, e.g., if need to use a lock
228228

229229
if is_total_slice(key, self._chunks):

zarr/sync.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,32 @@
77

88

99
class ArraySynchronizer(metaclass=ABCMeta):
10+
"""Abstract class defining the interface to a synchronization manager for a
11+
single array."""
1012

1113
@contextmanager
1214
@abstractmethod
13-
def lock_array(self): pass
15+
def lock_array(self):
16+
"""Obtain a lock on the entire array."""
17+
pass
1418

1519
@contextmanager
1620
@abstractmethod
17-
def lock_attrs(self): pass
21+
def lock_attrs(self):
22+
"""Obtain a lock on the user-defined attributes."""
23+
pass
1824

1925
@contextmanager
2026
@abstractmethod
21-
def lock_chunk(self, key): pass
27+
def lock_chunk(self, key):
28+
"""Obtain a lock on a single chunk.
29+
30+
Parameters
31+
----------
32+
key : tuple of ints
33+
Chunk index.
34+
"""
35+
pass
2236

2337

2438
class ThreadSynchronizer(ArraySynchronizer):

0 commit comments

Comments
 (0)