Skip to content

Commit

Permalink
Docstring improvements around relabel
Browse files Browse the repository at this point in the history
  • Loading branch information
gmou3 committed May 16, 2024
1 parent b993b9f commit 3057825
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 69 deletions.
6 changes: 3 additions & 3 deletions src/sage/matroids/basis_exchange_matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,13 @@ cdef class BasisExchangeMatroid(Matroid):

cdef _relabel(self, mapping):
"""
Relabel each element ``e`` as ``mapping[e]``, where ``mapping`` is a
Relabel each element `e` as ``mapping[e]``, where ``mapping`` is a
given injective map.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: ``None``
Expand Down
8 changes: 4 additions & 4 deletions src/sage/matroids/basis_matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -525,16 +525,16 @@ cdef class BasisMatroid(BasisExchangeMatroid):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down
8 changes: 4 additions & 4 deletions src/sage/matroids/circuit_closures_matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -527,16 +527,16 @@ cdef class CircuitClosuresMatroid(Matroid):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down
8 changes: 4 additions & 4 deletions src/sage/matroids/circuits_matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -368,16 +368,16 @@ cdef class CircuitsMatroid(Matroid):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down
10 changes: 5 additions & 5 deletions src/sage/matroids/database_matroids.py
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,7 @@ def Z(r, t=True, groundset=None):
- ``t`` -- boolean (default: ``True``); whether the spike is tipped
- ``groundset`` -- a string (optional); the groundset of the matroid
OUTPUT: a matroid; the unique rank-`r` binary spike (tipped or tipless)
OUTPUT: matroid; the unique rank-`r` binary spike (tipped or tipless)
EXAMPLES::
Expand Down Expand Up @@ -2172,7 +2172,7 @@ def Spike(r, t=True, C3=[], groundset=None):
The default (i.e. the empty list) results in a free `r`-spike
- ``groundset`` -- a string (optional); the groundset of the matroid
OUTPUT: a matroid; a rank-`r` spike (tipped or tipless)
OUTPUT: matroid; a rank-`r` spike (tipped or tipless)
EXAMPLES::
Expand Down Expand Up @@ -2290,7 +2290,7 @@ def Theta(n, groundset=None):
- ``n`` -- an integer (`n \ge 2`); the rank of the matroid
- ``groundset`` -- a string (optional); the groundset of the matroid
OUTPUT: a matroid (`\Theta_n`)
OUTPUT: matroid (`\Theta_n`)
EXAMPLES::
Expand Down Expand Up @@ -2363,7 +2363,7 @@ def Psi(r, groundset=None):
- ``r`` -- an integer (`r \ge 3`); the rank of the matroid
- ``groundset`` -- a string (optional); the groundset of the matroid
OUTPUT: a matroid (`\Psi_r`)
OUTPUT: matroid (`\Psi_r`)
EXAMPLES::
Expand Down Expand Up @@ -5233,7 +5233,7 @@ def _rename_and_relabel(M, name=None, groundset=None):
- ``name`` -- a string (optional)
- ``groundset`` -- a string (optional)
OUTPUT: a matroid
OUTPUT: matroid
"""
if groundset is not None:
if len(groundset) != len(M.groundset()):
Expand Down
6 changes: 3 additions & 3 deletions src/sage/matroids/dual_matroid.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,13 @@ def relabel(self, mapping):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``e not in mapping`` then the identity map is assumed.
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that `mapping[e]` is the new
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: matroid
Expand Down
8 changes: 4 additions & 4 deletions src/sage/matroids/flats_matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,16 @@ cdef class FlatsMatroid(Matroid):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down
8 changes: 4 additions & 4 deletions src/sage/matroids/graphic_matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1982,16 +1982,16 @@ cdef class GraphicMatroid(Matroid):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down
40 changes: 20 additions & 20 deletions src/sage/matroids/linear_matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2977,16 +2977,16 @@ cdef class LinearMatroid(BasisExchangeMatroid):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down Expand Up @@ -4029,16 +4029,16 @@ cdef class BinaryMatroid(LinearMatroid):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down Expand Up @@ -4911,16 +4911,16 @@ cdef class TernaryMatroid(LinearMatroid):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down Expand Up @@ -5623,16 +5623,16 @@ cdef class QuaternaryMatroid(LinearMatroid):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down Expand Up @@ -6552,16 +6552,16 @@ cdef class RegularMatroid(LinearMatroid):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down
30 changes: 15 additions & 15 deletions src/sage/matroids/matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ cdef class Matroid(SageObject):
- ``deletions`` is coindependent
- ``contractions`` and ``deletions`` are disjoint.
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down Expand Up @@ -1260,7 +1260,7 @@ cdef class Matroid(SageObject):
- ``hyperplanes`` -- the set of hyperplanes of a linear subclass of
``self``.
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down Expand Up @@ -4006,7 +4006,7 @@ cdef class Matroid(SageObject):
- ``deletions`` -- (default: ``None``) an element or set of elements
to be deleted
OUTPUT: a matroid
OUTPUT: matroid
.. NOTE::
Expand Down Expand Up @@ -4294,7 +4294,7 @@ cdef class Matroid(SageObject):
can be obtained by adding an element freely to the span of the matroid
and then contracting that element.
OUTPUT: a matroid
OUTPUT: matroid
.. SEEALSO::
Expand Down Expand Up @@ -4493,7 +4493,7 @@ cdef class Matroid(SageObject):
each of these. If not specified, the element is assumed to be in the
span of the full groundset.
OUTPUT: a matroid
OUTPUT: matroid
.. NOTE::
Expand Down Expand Up @@ -4570,7 +4570,7 @@ cdef class Matroid(SageObject):
of each of these. If not specified, the element is assumed to be in
the cospan of the full groundset.
OUTPUT: a matroid
OUTPUT: matroid
.. SEEALSO::
Expand Down Expand Up @@ -4899,7 +4899,7 @@ cdef class Matroid(SageObject):
parallel class (a closed set of rank 1, that is, each pair in it forms
a circuit of length 2).
OUTPUT: a matroid
OUTPUT: matroid
.. SEEALSO::
Expand Down Expand Up @@ -4935,7 +4935,7 @@ cdef class Matroid(SageObject):
element from each series class (a coclosed set of rank 1, that is,
each pair in it forms a cocircuit of length 2).
OUTPUT: a matroid
OUTPUT: matroid
.. SEEALSO::
Expand Down Expand Up @@ -8555,9 +8555,9 @@ cdef class Matroid(SageObject):
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``; if ``mapping[e]`` is not defined then the identity
map is assumed
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`; if ``mapping[e]`` is not defined then the identity map
is assumed
EXAMPLES::
Expand Down Expand Up @@ -8586,16 +8586,16 @@ cdef class Matroid(SageObject):
r"""
Return an isomorphic matroid with relabeled groundset.
The output is obtained by relabeling each element ``e`` by
The output is obtained by relabeling each element `e` by
``mapping[e]``, where ``mapping`` is a given injective map. If
``mapping[e]`` is not defined, then the identity map is assumed.
INPUT:
- ``mapping`` -- a python object such that ``mapping[e]`` is the new
label of ``e``
- ``mapping`` -- a Python object such that ``mapping[e]`` is the new
label of `e`
OUTPUT: a matroid
OUTPUT: matroid
EXAMPLES::
Expand Down
Loading

0 comments on commit 3057825

Please sign in to comment.