Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RepresentationType(Enum):
sage: chmr.RepresentationType.RegularLeft.is_regular()
True
"""
def is_split(self):
def is_split(self) -> bool:
r"""
Return ``True`` if this representation type is absolutely split,
``False`` else-wise.
Expand All @@ -88,7 +88,7 @@ def is_split(self):
"""
return self.value['split']

def is_regular(self):
def is_regular(self) -> bool:
r"""
Return ``True`` if this representation type is regular, ``False``
else-wise.
Expand Down
13 changes: 7 additions & 6 deletions src/sage/categories/crystals.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def example(self, choice='highwt', **kwds):

class MorphismMethods:
@cached_method
def is_isomorphism(self):
def is_isomorphism(self) -> bool:
"""
Check if ``self`` is a crystal isomorphism.

Expand All @@ -178,7 +178,7 @@ def is_isomorphism(self):

# TODO: This could be moved to sets
@cached_method
def is_embedding(self):
def is_embedding(self) -> bool:
"""
Check if ``self`` is an injective crystal morphism.

Expand Down Expand Up @@ -213,7 +213,7 @@ def is_embedding(self):
return True

@cached_method
def is_strict(self):
def is_strict(self) -> bool:
"""
Check if ``self`` is a strict crystal morphism.

Expand Down Expand Up @@ -1301,7 +1301,7 @@ def number_of_connected_components(self):
"""
return len(self.connected_components_generators())

def is_connected(self):
def is_connected(self) -> bool:
"""
Return ``True`` if ``self`` is a connected crystal.

Expand Down Expand Up @@ -1528,7 +1528,7 @@ def s(self, i):
b = b.e(i)
return b

def is_highest_weight(self, index_set=None):
def is_highest_weight(self, index_set=None) -> bool:
r"""
Return ``True`` if ``self`` is a highest weight.

Expand All @@ -1550,9 +1550,10 @@ def is_highest_weight(self, index_set=None):
index_set = self.index_set()
return all(self.e(i) is None for i in index_set)

def is_lowest_weight(self, index_set=None):
def is_lowest_weight(self, index_set=None) -> bool:
r"""
Return ``True`` if ``self`` is a lowest weight.

Specifying the option ``index_set`` to be a subset `I` of the
index set of the underlying crystal, finds all lowest
weight vectors for arrows in `I`.
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/monoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def _div_(left, right):
"""
return left * ~right

def is_one(self):
def is_one(self) -> bool:
r"""
Return whether ``self`` is the one of the monoid.

Expand Down Expand Up @@ -603,7 +603,7 @@ def algebra_generators(self):

class ElementMethods:

def is_central(self):
def is_central(self) -> bool:
r"""
Return whether the element ``self`` is central.

Expand Down
8 changes: 4 additions & 4 deletions src/sage/combinat/partition_kleshchev.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def mullineux_conjugate(self):
KP = mu.parent()
return KP.element_class(KP, mu.add_cell(*mu.cogood_cells( r-c-self.parent()._multicharge[0]) ))

def is_regular(self):
def is_regular(self) -> bool:
r"""
Return ``True`` if ``self`` is a `e`-regular partition tuple.

Expand All @@ -454,7 +454,7 @@ def is_regular(self):
KP = self.parent()
return super().is_regular(KP._e, KP._multicharge)

def is_restricted(self):
def is_restricted(self) -> bool:
r"""
Return ``True`` if ``self`` is an `e`-restricted partition tuple.

Expand Down Expand Up @@ -811,7 +811,7 @@ def mullineux_conjugate(self):
KP = mu.parent()
return KP.element_class(KP, mu.add_cell(*mu.cogood_cells( r-c-self.parent()._multicharge[k])))

def is_regular(self):
def is_regular(self) -> bool:
r"""
Return ``True`` if ``self`` is a `e`-regular partition tuple.

Expand All @@ -835,7 +835,7 @@ def is_regular(self):
KP = self.parent()
return _is_regular(self.to_list(), KP._multicharge, KP._convention)

def is_restricted(self):
def is_restricted(self) -> bool:
r"""
Return ``True`` if ``self`` is an `e`-restricted partition tuple.

Expand Down
9 changes: 5 additions & 4 deletions src/sage/combinat/root_system/reflection_group_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ def discriminant_in_invariant_ring(self, invariants=None):
return sum(coeffs[i] * mons[i] for i in range(m))

@cached_method
def is_crystallographic(self):
def is_crystallographic(self) -> bool:
r"""
Return ``True`` if ``self`` is crystallographic.

Expand Down Expand Up @@ -890,9 +890,10 @@ def is_crystallographic(self):
sage: W.is_crystallographic()
False
"""
return self.is_real() and all(t.to_matrix().base_ring() is QQ for t in self.simple_reflections())
return self.is_real() and all(t.to_matrix().base_ring() is QQ
for t in self.simple_reflections())

def number_of_irreducible_components(self):
def number_of_irreducible_components(self) -> int:
r"""
Return the number of irreducible components of ``self``.

Expand All @@ -908,7 +909,7 @@ def number_of_irreducible_components(self):
"""
return len(self._type)

def irreducible_components(self):
def irreducible_components(self) -> list:
r"""
Return a list containing the irreducible components of ``self``
as finite reflection groups.
Expand Down
9 changes: 4 additions & 5 deletions src/sage/combinat/species/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,10 @@ def _relabel(self, i):
[1, 2, 3]
"""
if isinstance(i, (int, Integer)):
return self._labels[i-1]
else:
return i
return self._labels[i - 1]
return i

def is_isomorphic(self, x):
def is_isomorphic(self, x) -> bool:
"""
EXAMPLES::

Expand All @@ -203,7 +202,7 @@ def is_isomorphic(self, x):
if self.parent() != x.parent():
return False

#We don't care about the labels for isomorphism testing
# We don't care about the labels for isomorphism testing
return self.canonical_label()._list == x.canonical_label()._list


Expand Down
14 changes: 7 additions & 7 deletions src/sage/combinat/subword_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def root_configuration(self):
Phi = self.parent().group().roots()
return [Phi[i] for i in self._root_configuration_indices()]

def kappa_preimage(self):
def kappa_preimage(self) -> list:
r"""
Return the fiber of ``self`` under the `\kappa` map.

Expand Down Expand Up @@ -403,7 +403,7 @@ def kappa_preimage(self):
if all(w.action_on_root_indices(i, side='left') < N
for i in root_conf)]

def is_vertex(self):
def is_vertex(self) -> bool:
r"""
Return ``True`` if ``self`` is a vertex of the brick polytope
of ``self.parent``.
Expand Down Expand Up @@ -1445,7 +1445,7 @@ def greedy_facet(self, side='positive'):

# topological properties

def is_sphere(self):
def is_sphere(self) -> bool:
r"""
Return ``True`` if the subword complex ``self`` is a sphere.

Expand All @@ -1472,7 +1472,7 @@ def is_sphere(self):
w = W.demazure_product(self._Q)
return w == self._pi

def is_ball(self):
def is_ball(self) -> bool:
r"""
Return ``True`` if the subword complex ``self`` is a ball.

Expand All @@ -1499,7 +1499,7 @@ def is_ball(self):
"""
return not self.is_sphere()

def is_pure(self):
def is_pure(self) -> bool:
r"""
Return ``True`` since all subword complexes are pure.

Expand Down Expand Up @@ -1541,7 +1541,7 @@ def dimension(self):
# root and weight

@cached_method
def is_root_independent(self):
def is_root_independent(self) -> bool:
r"""
Return ``True`` if ``self`` is root-independent.

Expand Down Expand Up @@ -1569,7 +1569,7 @@ def is_root_independent(self):
return M.rank() == max(M.ncols(), M.nrows())

@cached_method
def is_double_root_free(self):
def is_double_root_free(self) -> bool:
r"""
Return ``True`` if ``self`` is double-root-free.

Expand Down
36 changes: 19 additions & 17 deletions src/sage/dynamics/arithmetic_dynamics/wehlerK3.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __init__(self, polys):
vars = R.variable_names()
A = ProductProjectiveSpaces([2, 2],R.base_ring(),vars)
CR = A.coordinate_ring()
#Check for following:
# Check for following:
# Is the user calling in 2 polynomials from a list or tuple?
# Is there one biquadratic and one bilinear polynomial?
if len(polys) != 2:
Expand Down Expand Up @@ -411,7 +411,7 @@ def Hpoly(self, component, i, j):
sage: X.Hpoly(0, 1, 0)
2*y0*y1^3 + 2*y0*y1*y2^2 - y1*y2^3
"""
#Check Errors in Passed in Values
# Check Errors in Passed in Values
if component not in [0, 1]:
raise ValueError("component can only be 1 or 0")

Expand Down Expand Up @@ -709,7 +709,7 @@ def Ramification_poly(self, i):
4*((self._Lcoeff(i, 2))**2)*(self._Qcoeff(i, 1, 1))*(self._Qcoeff(i, 0, 0))

@cached_method
def is_degenerate(self):
def is_degenerate(self) -> bool:
r"""
Function will return ``True`` if there is a fiber (over the algebraic closure of the
base ring) of dimension greater than 0 and ``False`` otherwise.
Expand Down Expand Up @@ -751,7 +751,7 @@ def is_degenerate(self):
PP = self.ambient_space()
K = FractionField(PP[0].base_ring())
R = PP.coordinate_ring()
PS = PP[0] #check for x fibers
PS = PP[0] # check for x fibers
vars = list(PS.gens())
R0 = PolynomialRing(K, 3, vars) #for dimension calculation to work,
#must be done with Polynomial ring over a field
Expand All @@ -763,7 +763,7 @@ def is_degenerate(self):
if I.dimension() != 0:
return True

PS = PP[1] #check for y fibers
PS = PP[1] # check for y fibers
vars = list(PS.gens())
R0 = PolynomialRing(K,3,vars) #for dimension calculation to work,
#must be done with Polynomial ring over a field
Expand Down Expand Up @@ -840,7 +840,7 @@ def degenerate_fibers(self):
phi = R.hom(vars + [0, 0, 0], R0)
I = phi(I)
xFibers = []
#check affine charts
# check affine charts
for n in range(3):
affvars = list(R0.gens())
del affvars[n]
Expand Down Expand Up @@ -871,7 +871,7 @@ def degenerate_fibers(self):
phi = PP.coordinate_ring().hom([0, 0, 0] + vars, R0)
I = phi(I)
yFibers = []
#check affine charts
# check affine charts
for n in range(3):
affvars = list(R0.gens())
del affvars[n]
Expand All @@ -898,7 +898,7 @@ def degenerate_fibers(self):
@cached_method
def degenerate_primes(self, check=True):
r"""
Determine which primes `p` ``self`` has degenerate fibers over `\GF{p}`.
Determine primes `p` such that ``self`` has degenerate fibers over `\GF{p}`.

If ``check`` is ``False``, then may return primes that do not have degenerate fibers.
Raises an error if the surface is degenerate.
Expand Down Expand Up @@ -995,7 +995,7 @@ def degenerate_primes(self, check=True):
if power == 1:
bad_primes = bad_primes+GB[i].lt().coefficients()[0].support()
bad_primes = sorted(set(bad_primes))
#check to return only the truly bad primes
# check to return only the truly bad primes
if check:
for p in bad_primes:
X = self.change_ring(GF(p))
Expand Down Expand Up @@ -1041,7 +1041,7 @@ def is_smooth(self) -> bool:
R = self.ambient_space().coordinate_ring()
I = R.ideal(M.minors(2) + [self.L,self.Q])
T = PolynomialRing(self.ambient_space().base_ring().fraction_field(), 4, 'h')
#check the 9 affine charts for a singular point
# check the 9 affine charts for a singular point
for l in xmrange([3, 3]):
vars = list(T.gens())
vars.insert(l[0], 1)
Expand Down Expand Up @@ -1577,7 +1577,7 @@ def phi(self, a, **kwds):
(-1 : 0 : 1 , 0 : 1 : 0)
"""
A = self.sigmaX(a, **kwds)
kwds.update({"check":False})
kwds.update({"check": False})
return self.sigmaY(A, **kwds)

def psi(self, a, **kwds):
Expand Down Expand Up @@ -1617,7 +1617,7 @@ def psi(self, a, **kwds):
(0 : 0 : 1 , 0 : 1 : 0)
"""
A = self.sigmaY(a, **kwds)
kwds.update({"check":False})
kwds.update({"check": False})
return self.sigmaX(A, **kwds)

def lambda_plus(self, P, v, N, m, n, prec=100):
Expand Down Expand Up @@ -2411,9 +2411,9 @@ def orbit_psi(self, P, N, **kwds):
Orb.append(Q)
return Orb

def is_isomorphic(self, right):
def is_isomorphic(self, right) -> bool:
r"""
Check to see if two K3 surfaces have the same defining ideal.
Check whether two K3 surfaces have the same defining ideal.

INPUT:

Expand Down Expand Up @@ -2449,10 +2449,12 @@ def is_isomorphic(self, right):
"""
return self.defining_ideal() == right.defining_ideal()

def is_symmetric_orbit(self, orbit):
def is_symmetric_orbit(self, orbit) -> bool:
r"""
Check to see if the orbit is symmetric (i.e. if one of the points on the
orbit is fixed by '\sigma_x' or '\sigma_y').
Check whether the orbit is symmetric.

This means that one of the points on the
orbit is fixed by '\sigma_x' or '\sigma_y'.

INPUT:

Expand Down
Loading
Loading