Skip to content

Commit 95bd5c5

Browse files
committed
Very simple docs for tracked, obj, alias.
1 parent 08d59ce commit 95bd5c5

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ __pycache__/
22
.pytest_cache/
33
*.pyc
44
.coverage
5+
coverage.xml
56
build/
7+
junit/
68
dist/
79
*.egg-info/
810
htmlcov/

slicer/slicer_internal.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,15 @@ def resolve(item, dim):
207207

208208

209209
class Tracked(AtomicSlicer):
210-
def __init__(self, o: Any, dim: Union[int, List, None, str] = "auto"):
210+
""" Tracked defines an object that slicer wraps."""
211+
212+
def __init__(self, o: Any, dim: Union[int, List, tuple, None, str] = "auto"):
213+
""" Defines an object that will be wrapped by slicer.
214+
215+
Args:
216+
o: Object that will be tracked for slicer.
217+
dim: Target dimension(s) slicer will index on for this object.
218+
"""
211219
super().__init__(o)
212220

213221
# Protected attribute that can be overriden.
@@ -226,14 +234,14 @@ def __init__(self, o: Any, dim: Union[int, List, None, str] = "auto"):
226234
raise ValueError(f"Cannot handle dim of type: {type(dim)}")
227235

228236

229-
# TODO: Document.
230237
class Obj(Tracked):
238+
""" An object that slicer wraps. """
231239
def __init__(self, o, dim="auto"):
232240
super().__init__(o, dim)
233241

234242

235-
# NOTE: Alias is different at init as dim is now required.
236243
class Alias(Tracked):
244+
""" Defines a tracked object as well as additional __getitem__ keys. """
237245
def __init__(self, o, dim):
238246
if not (
239247
isinstance(dim, int) or isinstance(dim, list) and len(dim) <= 1

0 commit comments

Comments
 (0)