Skip to content

Commit fc37e70

Browse files
committed
cleanup and better docstrings
1 parent 4738117 commit fc37e70

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

larray/core/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,8 +2664,8 @@ def _cum_aggregate(self, op, axis):
26642664
return Array(op(np.asarray(self), axis=self.axes.index(axis)),
26652665
self.axes)
26662666

2667-
# TODO: now that items is never a (k, v), it should be renamed to
2668-
# something else: args? (groups would be misleading because each "item" can contain several groups)
2667+
# TODO: now that items is never a (k, v), it should be renamed to something else: args?
2668+
# (groups would be misleading because each "item" can contain several groups)
26692669
# TODO: experiment implementing this using ufunc.reduceat
26702670
# http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.ufunc.reduceat.html
26712671
# XXX: rename keepaxes to label=value? For group_aggregates we might want to keep the LGroup label if any

larray/core/axis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ def matching(self, deprecated=None, pattern=None, regex=None):
578578
579579
Parameters
580580
----------
581-
pattern : str or Group
581+
pattern : str or Group, optional
582582
Pattern to match.
583583
* `?` matches any single character
584584
* `*` matches any number of characters
@@ -587,7 +587,7 @@ def matching(self, deprecated=None, pattern=None, regex=None):
587587
588588
To match any of the special characters above, wrap the character in brackets. For example, `[?]` matches
589589
the character `?`.
590-
regex : str or Group
590+
regex : str or Group, optional
591591
Regular expression pattern to match. Regular expressions are more powerful than what the simple patterns
592592
supported by the `pattern` argument but are also more complex to write.
593593
See `Regular Expression <https://docs.python.org/3/library/re.html>`_ for more details about how to build
@@ -3230,7 +3230,7 @@ def split_axes(self, axes=None, sep='_', names=None, regex=None):
32303230
names : str or list of str, optional
32313231
names of resulting axes. Defaults to None.
32323232
regex : str, optional
3233-
use regex instead of delimiter to split labels. Defaults to None.
3233+
use the `regex` regular expression to split labels instead of the `sep` delimiter. Defaults to None.
32343234
32353235
See Also
32363236
--------
@@ -3260,7 +3260,7 @@ def split_axes(self, axes=None, sep='_', names=None, regex=None):
32603260
Axis(['b0', 'b1', 'b2'], 'b')
32613261
])
32623262
3263-
Split labels using regex
3263+
Split labels using a regular expression
32643264
32653265
>>> combined = AxisCollection('a_b = a0b0..a1b2')
32663266
>>> combined

larray/core/group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ def translate(self, bound=None, stop=False):
15821582
bound = self.key
15831583
if isinstance(self.axis, ABCAxis):
15841584
pos = self.axis.index(bound)
1585-
return pos + int(stop) if np.isscalar(pos) else pos
1585+
return (pos + int(stop)) if np.isscalar(pos) else pos
15861586
else:
15871587
raise ValueError("Cannot translate an LGroup without axis")
15881588

0 commit comments

Comments
 (0)