Skip to content

Commit

Permalink
auto-annotation by ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Jan 22, 2024
1 parent bc8a404 commit b34ac5f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/sage/combinat/posets/cartesian_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CartesianProductPoset(CartesianProduct):
:class:`CartesianProduct`
"""

def __init__(self, sets, category, order=None, **kwargs):
def __init__(self, sets, category, order=None, **kwargs) -> None:
r"""
See :class:`CartesianProductPoset` for details.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/posets/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class PosetElement(Element):

def __init__(self, poset, element, vertex):
def __init__(self, poset, element, vertex) -> None:
r"""
Establish the parent-child relationship between ``poset``
and ``element``, where ``element`` is associated to the
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/posets/hasse_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LatticeError(ValueError):
a and b" instead of "No meet for 1 and 2".
"""

def __init__(self, fail, x, y):
def __init__(self, fail, x, y) -> None:
"""
Initialize the exception.
Expand All @@ -56,7 +56,7 @@ def __init__(self, fail, x, y):
self.x = x
self.y = y

def __str__(self):
def __str__(self) -> str:
"""
Return string representation of the exception.
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/posets/incidence_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class IncidenceAlgebra(CombinatorialFreeModule):
- :wikipedia:`Incidence_algebra`
"""
def __init__(self, R, P, prefix='I'):
def __init__(self, R, P, prefix='I') -> None:
"""
Initialize ``self``.
Expand Down Expand Up @@ -438,7 +438,7 @@ class ReducedIncidenceAlgebra(CombinatorialFreeModule):
`[x, y]` is isomorphic to `[x', y']` as posets. Thus the delta, Möbius,
and zeta functions are all elements of `R_P`.
"""
def __init__(self, I, prefix='R'):
def __init__(self, I, prefix='R') -> None:
"""
Initialize ``self``.
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/posets/linear_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def __classcall_private__(cls, poset, facade=False):
"""
return super().__classcall__(cls, poset, facade=facade)

def __init__(self, poset, facade):
def __init__(self, poset, facade) -> None:
"""
TESTS::
Expand Down Expand Up @@ -671,7 +671,7 @@ def __iter__(self):
for lin_ext in linear_extension_iterator(self._poset._hasse_diagram):
yield self._element_constructor_([vertex_to_element(_) for _ in lin_ext])

def __contains__(self, obj):
def __contains__(self, obj) -> bool:
"""
Membership testing
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/posets/mobile.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class MobilePoset(FinitePoset):
_lin_ext_type = LinearExtensionsOfMobile
_desc = 'Finite mobile poset'

def __init__(self, hasse_diagram, elements, category, facade, key, ribbon=None, check=True):
def __init__(self, hasse_diagram, elements, category, facade, key, ribbon=None, check=True) -> None:
r"""
Initialize ``self``.
Expand Down
14 changes: 7 additions & 7 deletions src/sage/combinat/posets/moebius_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class MoebiusAlgebra(Parent, UniqueRepresentation):
European Journal of Combinatorics, **19**, 1998.
:doi:`10.1006/eujc.1998.0227`.
"""
def __init__(self, R, L):
def __init__(self, R, L) -> None:
"""
Initialize ``self``.
Expand Down Expand Up @@ -161,7 +161,7 @@ class E(BasisAbstract):
Let `E_x` and `E_y` be basis elements of `M_L` for some lattice `L`.
Multiplication is given by `E_x E_y = E_{x \vee y}`.
"""
def __init__(self, M, prefix='E'):
def __init__(self, M, prefix='E') -> None:
"""
Initialize ``self``.
Expand Down Expand Up @@ -242,7 +242,7 @@ class I(BasisAbstract):
Multiplication is given by `I_x I_y = \delta_{xy} I_x` where
`\delta_{xy}` is the Kronecker delta.
"""
def __init__(self, M, prefix='I'):
def __init__(self, M, prefix='I') -> None:
"""
Initialize ``self``.
Expand Down Expand Up @@ -381,7 +381,7 @@ class QuantumMoebiusAlgebra(Parent, UniqueRepresentation):
\operatorname{rank} L - \operatorname{rank}` a). At `q = 1`, this
reduces to the multiplication formula originally given by Solomon.
"""
def __init__(self, L, q=None):
def __init__(self, L, q=None) -> None:
"""
Initialize ``self``.
Expand Down Expand Up @@ -471,7 +471,7 @@ class E(BasisAbstract):
is the corank function (i.e., `\operatorname{crk} a =
\operatorname{rank} L - \operatorname{rank}` a).
"""
def __init__(self, M, prefix='E'):
def __init__(self, M, prefix='E') -> None:
"""
Initialize ``self``.
Expand Down Expand Up @@ -547,7 +547,7 @@ class C(BasisAbstract):
filter of `x` and `P(F^x; q)` is the characteristic polynomial
of the (sub)poset `F^x`.
"""
def __init__(self, M, prefix='C'):
def __init__(self, M, prefix='C') -> None:
"""
Initialize ``self``.
Expand Down Expand Up @@ -626,7 +626,7 @@ class KL(BasisAbstract):
sage: KL[4] * KL[10]
(q+3*q^2+3*q^3+q^4)*KL[14] + (1+4*q+6*q^2+4*q^3+q^4)*KL[15]
"""
def __init__(self, M, prefix='KL'):
def __init__(self, M, prefix='KL') -> None:
"""
Initialize ``self``.
Expand Down
8 changes: 4 additions & 4 deletions src/sage/combinat/posets/posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ def __classcall__(cls, hasse_diagram, elements=None, category=None, facade=None,
category=category, facade=facade,
key=key)

def __init__(self, hasse_diagram, elements, category, facade, key):
def __init__(self, hasse_diagram, elements, category, facade, key) -> None:
r"""
EXAMPLES::
Expand Down Expand Up @@ -1230,7 +1230,7 @@ def unwrap(self, element):
else:
return element.element

def __contains__(self, x):
def __contains__(self, x) -> bool:
r"""
Return ``True`` if ``x`` is an element of the poset.
Expand Down Expand Up @@ -8909,7 +8909,7 @@ class FinitePosets_n(UniqueRepresentation, Parent):
[[1, 2], [0, 2]]
"""

def __init__(self, n):
def __init__(self, n) -> None:
r"""
EXAMPLES::
Expand All @@ -8934,7 +8934,7 @@ def _repr_(self):
"""
return "Posets containing %s elements" % self._n

def __contains__(self, P):
def __contains__(self, P) -> bool:
"""
EXAMPLES::
Expand Down

0 comments on commit b34ac5f

Please sign in to comment.