Skip to content

Commit 4df3644

Browse files
committed
better docstring/comments
1 parent a5f34a4 commit 4df3644

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

larray/core.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ def __hash__(self):
652652
# hashing them directly
653653
#XXX: but we might want to include that normalization feature in
654654
# to_tick directly, instead of using to_key explicitly here
655+
# different name or axis hash to the same thing !
655656
return hash(to_tick(to_key(self.key)))
656657

657658
def __eq__(self, other):
@@ -920,9 +921,10 @@ def full_key(self, key):
920921
# handle keys containing ValueGroups (at potentially wrong places)
921922
if any(isinstance(axis_key, ValueGroup) for axis_key in key):
922923
#XXX: support ValueGroup without axis?
923-
listkey = [(axis_key.axis.name
924-
if isinstance(axis_key, ValueGroup)
925-
else axis_name, axis_key)
924+
# extract axis name from ValueGroup keys
925+
listkey = [(axis_key.axis.name if isinstance(axis_key, ValueGroup)
926+
else axis_name,
927+
axis_key)
926928
for axis_key, axis_name in zip(key, self.axes_names)]
927929
dupe_axes = list(duplicates(k for k, v in listkey))
928930
if dupe_axes:
@@ -1311,6 +1313,9 @@ def translated_key(self, key):
13111313
for axis, k in zip(self.axes, key))
13121314

13131315
def _df_axis_level(self, axis):
1316+
"""
1317+
translates LArray Axis spec into a Pandas axis + level
1318+
"""
13141319
axis_idx = self.axes.index(axis)
13151320
index_ndim = self._df_index_ndim
13161321
if axis_idx < index_ndim:

0 commit comments

Comments
 (0)