Skip to content

Commit b796554

Browse files
committed
>> replaced r""" by """ in doc_varargs declaration + updated split_axes()
1 parent abef5c8 commit b796554

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

larray/core/array.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ def _doc_agg_method(func, by=False, long_name='', action_verb='perform', extra_a
498498

499499
doc_args = "".join(_arg_agg[arg] for arg in extra_args)
500500
doc_kwargs = "".join(_kwarg_agg[kw]['doc'] for kw in kwargs)
501-
doc_varargs = r"""
502-
*axes_and_groups : None or int or str or Axis or Group or any combination of those
501+
doc_varargs = """
502+
\*axes_and_groups : None or int or str or Axis or Group or any combination of those
503503
{specific}
504504
The default (no axis or group) is to {action_verb} the {long_name} over all the dimensions of the input
505505
array.
@@ -7048,7 +7048,7 @@ def combine_axes(self, axes=None, sep='_', wildcard=False):
70487048
return transposed.reshape(new_axes)
70497049

70507050
def split_axes(self, axes=None, sep='_', names=None, regex=None, sort=False, fill_value=nan):
7051-
"""Split axes and returns a new array
7051+
r"""Split axes and returns a new array
70527052
70537053
Parameters
70547054
----------
@@ -7079,15 +7079,15 @@ def split_axes(self, axes=None, sep='_', names=None, regex=None, sort=False, fil
70797079
--------
70807080
>>> arr = ndtest((2, 3))
70817081
>>> arr
7082-
a\\b b0 b1 b2
7082+
a\b b0 b1 b2
70837083
a0 0 1 2
70847084
a1 3 4 5
70857085
>>> combined = arr.combine_axes()
70867086
>>> combined
70877087
a_b a0_b0 a0_b1 a0_b2 a1_b0 a1_b1 a1_b2
70887088
0 1 2 3 4 5
70897089
>>> combined.split_axes()
7090-
a\\b b0 b1 b2
7090+
a\b b0 b1 b2
70917091
a0 0 1 2
70927092
a1 3 4 5
70937093
@@ -7097,23 +7097,23 @@ def split_axes(self, axes=None, sep='_', names=None, regex=None, sort=False, fil
70977097
>>> combined
70987098
a_b a0b0 a0b1 a0b2 a1b0 a1b1 a1b2
70997099
0 1 2 3 4 5
7100-
>>> combined.split_axes('a_b', regex=r'(\\w{2})(\\w{2})')
7101-
a\\b b0 b1 b2
7100+
>>> combined.split_axes('a_b', regex=r'(\w{2})(\w{2})')
7101+
a\b b0 b1 b2
71027102
a0 0 1 2
71037103
a1 3 4 5
71047104
71057105
Split several axes at once
71067106
71077107
>>> combined = ndtest('a_b=a0_b0..a1_b1; c_d=c0_d0..c1_d1')
71087108
>>> combined
7109-
a_b\\c_d c0_d0 c0_d1 c1_d0 c1_d1
7109+
a_b\c_d c0_d0 c0_d1 c1_d0 c1_d1
71107110
a0_b0 0 1 2 3
71117111
a0_b1 4 5 6 7
71127112
a1_b0 8 9 10 11
71137113
a1_b1 12 13 14 15
71147114
>>> # equivalent to combined.split_axes() which split all axes whose name contains the `sep` delimiter.
71157115
>>> combined.split_axes(['a_b', 'c_d'])
7116-
a b c\\d d0 d1
7116+
a b c\d d0 d1
71177117
a0 b0 c0 0 1
71187118
a0 b0 c1 2 3
71197119
a0 b1 c0 4 5
@@ -7123,7 +7123,7 @@ def split_axes(self, axes=None, sep='_', names=None, regex=None, sort=False, fil
71237123
a1 b1 c0 12 13
71247124
a1 b1 c1 14 15
71257125
>>> combined.split_axes({'a_b': ('A', 'B'), 'c_d': ('C', 'D')})
7126-
A B C\\D d0 d1
7126+
A B C\D d0 d1
71277127
a0 b0 c0 0 1
71287128
a0 b0 c1 2 3
71297129
a0 b1 c0 4 5

larray/core/axis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,7 +2906,7 @@ def combine_axes(self, axes=None, sep='_', wildcard=False, front_if_spread=False
29062906
return new_axes
29072907

29082908
def split_axes(self, axes=None, sep='_', names=None, regex=None):
2909-
"""Split axes and returns a new collection
2909+
r"""Split axes and returns a new collection
29102910
29112911
The split axes are inserted where the combined axis was.
29122912
@@ -2959,7 +2959,7 @@ def split_axes(self, axes=None, sep='_', names=None, regex=None):
29592959
AxisCollection([
29602960
Axis(['a0b0', 'a0b1', 'a0b2', 'a1b0', 'a1b1', 'a1b2'], 'a_b')
29612961
])
2962-
>>> combined.split_axes('a_b', regex='(\\\\w{2})(\\\\w{2})')
2962+
>>> combined.split_axes('a_b', regex=r'(\w{2})(\w{2})')
29632963
AxisCollection([
29642964
Axis(['a0', 'a1'], 'a'),
29652965
Axis(['b0', 'b1', 'b2'], 'b')

0 commit comments

Comments
 (0)