Skip to content

Commit 28be7e7

Browse files
committed
slice object -> slice item
1 parent d43c311 commit 28be7e7

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

zappend/config/config.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,24 @@ def target_dir(self) -> FileObj:
114114

115115
@property
116116
def slice_engine(self) -> str | None:
117-
"""The configured slice engine to be used if a slice object is not a Zarr.
117+
"""The configured slice engine to be used if a slice path or URI does not
118+
point to a dataset in Zarr format.
118119
If defined, it will be passed to the `xarray.open_dataset()` function.
119120
"""
120121
return self._config.get("slice_engine")
121122

122123
@property
123124
def slice_source(self) -> Callable[[...], Any] | None:
124125
"""The configured slice source type. If given, it must be
125-
a callable that returns a `SliceObj` or a class that is derived from
126-
`SliceSource` or implements its interface."""
126+
a callable that returns a value of type `SliceItem` or a class that is
127+
derived from `SliceSource` abstract base class.
128+
"""
127129
return self._slice_source
128130

129131
@property
130132
def slice_storage_options(self) -> dict[str, Any] | None:
131133
"""The configured slice storage options to be used
132-
if a slice object is a Zarr.
134+
if a slice item is a URI.
133135
"""
134136
return self._config.get("slice_storage_options")
135137

zappend/processor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ def process_slices(self, slices: Iterable[SliceItem]):
6363
Passes each slice in `slices` to the `process_slice()` method.
6464
6565
Args:
66-
slices: Slice objects.
66+
slices: Iterable of slice items.
6767
"""
6868
with self._profiler:
6969
for slice_index, slice_item in enumerate(slices):
7070
self.process_slice(slice_item, slice_index=slice_index)
7171

7272
def process_slice(self, slice_item: SliceItem, slice_index: int = 0):
73-
"""Process a single slice object *slice_item*.
73+
"""Process a single slice item *slice_item*.
7474
7575
If there is no target yet, just config and slice:
7676
@@ -89,7 +89,7 @@ def process_slice(self, slice_item: SliceItem, slice_index: int = 0):
8989
* update target from slice
9090
9191
Args:
92-
slice_item: The slice object.
92+
slice_item: The slice item.
9393
slice_index: An index identifying the slice.
9494
"""
9595

zappend/slice/cm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def open_slice_dataset(
3939
slice_item: Any,
4040
slice_index: int = 0,
4141
) -> SliceSourceContextManager:
42-
"""Open the slice source for given slice object `slice_item`.
42+
"""Open the slice source for given slice item `slice_item`.
4343
4444
The intended and only use of the returned slice source is as context
4545
manager. When used as context manager the slice source yields a slice
@@ -58,7 +58,7 @@ class derived from `zappend.slice.SliceSource` or a function that returns
5858
* `dict`: keyword arguments only;
5959
* Any other type is interpreted as single positional argument.
6060
61-
If `slice_source` is not specified in the configuration, the slice object
61+
If `slice_source` is not specified in the configuration, the slice item
6262
`slice_item` may have one of the following types:
6363
6464
* `str`: A local file path or URI pointing to a dataset file such as a

0 commit comments

Comments
 (0)