Skip to content

Commit e485fd8

Browse files
committed
DOC: better docstring for AxisCollection._key_to_raw_and_axes and Axis.iscompatible
1 parent dffdd9e commit e485fd8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

larray/core/axis.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,9 @@ def iscompatible(self, other):
536536
r"""
537537
Checks if self is compatible with another axis.
538538
539-
* Two non-wildcard axes are compatible if they have the same name and labels.
539+
* two axes are compatible if they have compatible names and labels
540+
* names are compatible if they are the same or missing
541+
* non-wildcard labels are compatible if they are the same
540542
* A wildcard axis of length 1 is compatible with any other axis sharing the same name.
541543
* A wildcard axis of length > 1 is compatible with any axis of the same length or length 1 and sharing the
542544
same name.
@@ -572,6 +574,7 @@ def iscompatible(self, other):
572574
return False
573575
if self.name is not None and other.name is not None and self.name != other.name:
574576
return False
577+
575578
if self.iswildcard or other.iswildcard:
576579
# wildcard axes of length 1 match with anything
577580
# wildcard axes of length > 1 match with equal len or len 1
@@ -2843,6 +2846,8 @@ def _key_to_raw_and_axes(self, key, collapse_slices=False, translate_key=True, p
28432846
any key supported by Array.__getitem__
28442847
collapse_slices : bool, optional
28452848
Whether or not to convert ranges to slices. Defaults to False.
2849+
translate_key : bool, optional
2850+
Whether or not to consider key as label-based. Defaults to True.
28462851
28472852
Returns
28482853
-------

0 commit comments

Comments
 (0)