Skip to content

Commit f978df0

Browse files
committed
DOC: add concat to docs
1 parent ae50f6e commit f978df0

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

cycler.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,20 @@ def simplify(self):
390390
return reduce(add, (_cycler(k, v) for k, v in six.iteritems(trans)))
391391

392392
def concat(self, other):
393+
"""Concatenate two cyclers.
394+
395+
The keys must match exactly.
396+
397+
Parameters
398+
----------
399+
other : `Cycler`
400+
The `Cycler` instances to concatenate to this one
401+
402+
Returns
403+
-------
404+
ret : `Cycler`
405+
The concatenated `Cycler`
406+
"""
393407
return concat(self, other)
394408

395409

doc/source/index.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,22 @@ Integer Multiplication
180180
2 * color_cycle
181181
182182
183+
Concatenation
184+
~~~~~~~~~~~~~
185+
186+
`Cycler` objects can be concatenated either via the :py:meth:`Cycler.concat` method
187+
188+
.. ipython:: python
189+
190+
color_cycle.concat(color_cycle)
191+
192+
or the top-level :py:func:`concat` function
193+
194+
.. ipython:: python
195+
196+
from cycler import concat
197+
concat(color_cycle, color_cycle)
198+
183199
184200
Slicing
185201
-------

0 commit comments

Comments
 (0)