Skip to content

Commit 1af6f29

Browse files
author
Release Manager
committed
gh-35452: fix all pycodestyle E303 warnings in rings/ <!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description This is fixing all pep8 E303 warnings in the rings/ folder Purely done with autopep8. There remains only to handle later schemes/ in another pull request and then activate the check in the linter. <!-- Describe your changes here in detail. --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35452 Reported by: Frédéric Chapoton Reviewer(s): Matthias Köppe
2 parents 07b7c98 + 112db80 commit 1af6f29

37 files changed

+0
-148
lines changed

src/sage/rings/asymptotic/asymptotic_expansion_generators.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ def Stirling(var, precision=None, skip_constant_factor=False):
197197

198198
return result
199199

200-
201200
@staticmethod
202201
def log_Stirling(var, precision=None, skip_constant_summand=False):
203202
r"""
@@ -321,7 +320,6 @@ def log_Stirling(var, precision=None, skip_constant_summand=False):
321320

322321
return result
323322

324-
325323
@staticmethod
326324
def _log_StirlingNegativePowers_(var, precision):
327325
r"""
@@ -371,7 +369,6 @@ def _log_StirlingNegativePowers_(var, precision):
371369
A.zero())
372370
return result + (1 / n**(2*precision + 1)).O()
373371

374-
375372
@staticmethod
376373
def HarmonicNumber(var, precision=None, skip_constant_summand=False):
377374
r"""
@@ -477,7 +474,6 @@ def HarmonicNumber(var, precision=None, skip_constant_summand=False):
477474

478475
return result
479476

480-
481477
@staticmethod
482478
def Binomial_kn_over_n(var, k, precision=None, skip_constant_factor=False):
483479
r"""
@@ -603,7 +599,6 @@ def Binomial_kn_over_n(var, k, precision=None, skip_constant_factor=False):
603599

604600
return result
605601

606-
607602
@staticmethod
608603
def SingularityAnalysis(var, zeta=1, alpha=0, beta=0, delta=0,
609604
precision=None, normalized=True):
@@ -961,7 +956,6 @@ def inverse_gamma_derivative(shift, r):
961956
if precision is None:
962957
precision = series_precision()
963958

964-
965959
if not normalized and not (beta in ZZ and delta in ZZ):
966960
raise ValueError("beta and delta must be integers")
967961
if delta != 0:
@@ -1040,7 +1034,6 @@ def inverse_gamma_derivative(shift, r):
10401034

10411035
return result
10421036

1043-
10441037
@staticmethod
10451038
@experimental(20050)
10461039
def ImplicitExpansion(var, phi, tau=None, precision=None):
@@ -1208,7 +1201,6 @@ def ansatz(prec=precision):
12081201

12091202
return A(tau) + ansatz(prec=precision-1).map_coefficients(lambda term: term.subs(solution_dict).simplify_rational())
12101203

1211-
12121204
@staticmethod
12131205
@experimental(20050)
12141206
def ImplicitExpansionPeriodicPart(var, phi, period, tau=None, precision=None):
@@ -1298,7 +1290,6 @@ def ImplicitExpansionPeriodicPart(var, phi, period, tau=None, precision=None):
12981290
Z = aperiodic_expansion.parent().gen()
12991291
return 1/rho * (aperiodic_expansion/(1 - 1/Z))**(1/period)
13001292

1301-
13021293
@staticmethod
13031294
def InverseFunctionAnalysis(var, phi, tau=None, period=1, precision=None):
13041295
r"""

src/sage/rings/asymptotic/asymptotic_ring.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,6 @@ def _mul_term_(self, term):
12091209
return self.parent()(self.summands.mapped(lambda element: term * element),
12101210
simplify=simplify, convert=False)
12111211

1212-
12131212
def _mul_(self, other):
12141213
r"""
12151214
Multiply this asymptotic expansion by another asymptotic expansion ``other``.
@@ -1309,7 +1308,6 @@ def _div_(self, other):
13091308
"""
13101309
return self * ~other
13111310

1312-
13131311
def __invert__(self, precision=None):
13141312
r"""
13151313
Return the multiplicative inverse of this element.
@@ -1485,7 +1483,6 @@ def exact_part(self):
14851483

14861484
return self.parent(exact_terms)
14871485

1488-
14891486
def error_part(self):
14901487
r"""
14911488
Return the expansion consisting of all error terms of this
@@ -1511,7 +1508,6 @@ def error_part(self):
15111508
if not term.is_exact()),
15121509
parent.zero())
15131510

1514-
15151511
def __pow__(self, exponent, precision=None):
15161512
r"""
15171513
Calculate the power of this asymptotic expansion to the given ``exponent``.
@@ -1717,10 +1713,8 @@ def __pow__(self, exponent, precision=None):
17171713
raise combine_exceptions(
17181714
ValueError('Cannot take %s to the exponent %s.' % (self, exponent)), e)
17191715

1720-
17211716
pow = __pow__
17221717

1723-
17241718
def __pow_number__(self, exponent, precision=None, check_convergence=False):
17251719
r"""
17261720
Return the power of this asymptotic expansion to some
@@ -1873,7 +1867,6 @@ def binomials(a):
18731867

18741868
return result * pmax
18751869

1876-
18771870
def sqrt(self, precision=None):
18781871
r"""
18791872
Return the square root of this asymptotic expansion.
@@ -2244,7 +2237,6 @@ def rpow(self, base, precision=None, locals=None):
22442237
if not expr_o:
22452238
return large_result
22462239

2247-
22482240
if base == 'e':
22492241
geom = expr_o
22502242
else:
@@ -3911,7 +3903,6 @@ def _create_empty_summands_():
39113903
can_merge=can_absorb,
39123904
merge=absorption)
39133905

3914-
39153906
def _create_element_in_extension_(self, term, old_term_parent=None):
39163907
r"""
39173908
Create an element in an extension of this asymptotic ring which

src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3324,7 +3324,6 @@ def _an_element_(self):
33243324
from sage.rings.semirings.non_negative_integer_semiring import NN
33253325
return self(NN.an_element(), [(self.base().an_element(), NN(3))])
33263326

3327-
33283327
Element = FractionWithFactoredDenominator
33293328

33303329

src/sage/rings/asymptotic/growth_group.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ def __init__(self, var, repr=None, latex_name=None, ignore=None):
381381
raise ValueError('Variable names %s are not pairwise distinct.' %
382382
(var_bases,))
383383

384-
385384
self.var_bases = var_bases
386385
self.var_repr = var_repr
387386

@@ -1679,7 +1678,6 @@ class GenericGrowthGroup(UniqueRepresentation, Parent, WithLocals):
16791678
# enable the category framework for elements
16801679
Element = GenericGrowthElement
16811680

1682-
16831681
# set everything up to determine category
16841682
from sage.categories.sets_cat import Sets
16851683
from sage.categories.posets import Posets

src/sage/rings/asymptotic/growth_group_cartesian.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ def create_key_and_extra_args(self, growth_groups, category, **kwds):
196196

197197
return (tuple(growth_groups), category), kwds
198198

199-
200199
def create_object(self, version, args, **kwds):
201200
r"""
202201
Create an object from the given arguments.
@@ -287,7 +286,6 @@ class GenericProduct(CartesianProductPoset, GenericGrowthGroup):
287286

288287
__classcall__ = CartesianProductPoset.__classcall__
289288

290-
291289
def __init__(self, sets, category, **kwds):
292290
r"""
293291
See :class:`GenericProduct` for details.
@@ -319,10 +317,8 @@ def __init__(self, sets, category, **kwds):
319317

320318
GenericGrowthGroup.__init__(self, sets[0], Vars, self.category(), **kwds)
321319

322-
323320
__hash__ = CartesianProductPoset.__hash__
324321

325-
326322
def some_elements(self):
327323
r"""
328324
Return some elements of this Cartesian product of growth groups.
@@ -399,7 +395,6 @@ def _create_element_in_extension_(self, element):
399395
category=self.category())
400396
return parent(element)
401397

402-
403398
def _element_constructor_(self, data):
404399
r"""
405400
Converts the given object to an element of this Cartesian
@@ -520,10 +515,8 @@ def convert_factors(data, raw_data):
520515

521516
return convert_factors((data,), data)
522517

523-
524518
_repr_ = GenericGrowthGroup._repr_
525519

526-
527520
def _repr_short_(self):
528521
r"""
529522
A short (shorter than :meth:`._repr_`) representation string
@@ -547,7 +540,6 @@ def _repr_short_(self):
547540
"""
548541
return ' * '.join(S._repr_short_() for S in self.cartesian_factors())
549542

550-
551543
def _convert_factors_(self, factors):
552544
r"""
553545
Helper method. Try to convert some ``factors`` to an
@@ -617,7 +609,6 @@ def get_factors(data):
617609
return prod(self.cartesian_injection(*fs)
618610
for f in factors for fs in get_factors(f))
619611

620-
621612
def cartesian_injection(self, factor, element):
622613
r"""
623614
Inject the given element into this Cartesian product at the given factor.
@@ -642,7 +633,6 @@ def cartesian_injection(self, factor, element):
642633
return self(tuple((f.one() if f != factor else element)
643634
for f in self.cartesian_factors()))
644635

645-
646636
def _coerce_map_from_(self, S):
647637
r"""
648638
Return whether ``S`` coerces into this growth group.
@@ -677,7 +667,6 @@ def _coerce_map_from_(self, S):
677667
for f in factors):
678668
return True
679669

680-
681670
def _pushout_(self, other):
682671
r"""
683672
Construct the pushout of this and the other growth group. This is called by
@@ -864,7 +853,6 @@ def next_custom(self):
864853
from sage.categories.cartesian_product import cartesian_product
865854
return pushout(cartesian_product(newS), cartesian_product(newO))
866855

867-
868856
def gens_monomial(self):
869857
r"""
870858
Return a tuple containing monomial generators of this growth group.
@@ -900,7 +888,6 @@ def gens_monomial(self):
900888
for factor in self.cartesian_factors()),
901889
tuple())
902890

903-
904891
def variable_names(self):
905892
r"""
906893
Return the names of the variables.
@@ -921,13 +908,11 @@ def variable_names(self):
921908
from itertools import groupby
922909
return tuple(v for v, _ in groupby(vars))
923910

924-
925911
class Element(CartesianProductPoset.Element):
926912

927913
from .growth_group import _is_lt_one_
928914
is_lt_one = _is_lt_one_
929915

930-
931916
def _repr_(self, latex=False):
932917
r"""
933918
A representation string for this Cartesian product element.
@@ -961,7 +946,6 @@ def _repr_(self, latex=False):
961946
return '1'
962947
return s
963948

964-
965949
def _latex_(self):
966950
r"""
967951
A representation string for this Cartesian product element.
@@ -982,7 +966,6 @@ def _latex_(self):
982966
"""
983967
return self._repr_(latex=True)
984968

985-
986969
def __pow__(self, exponent):
987970
r"""
988971
Calculate the power of this growth element to the given
@@ -1013,7 +996,6 @@ def __pow__(self, exponent):
1013996
return self.parent()._create_element_in_extension_(
1014997
tuple(x ** exponent for x in self.cartesian_factors()))
1015998

1016-
1017999
def factors(self):
10181000
r"""
10191001
Return the atomic factors of this growth element. An atomic factor
@@ -1062,12 +1044,10 @@ def factors(self):
10621044
if not f.is_one()),
10631045
tuple())
10641046

1065-
10661047
from .growth_group import _log_factor_, _log_
10671048
log = _log_
10681049
log_factor = _log_factor_
10691050

1070-
10711051
def _log_factor_(self, base=None, locals=None):
10721052
r"""
10731053
Helper method for calculating the logarithm of the factorization
@@ -1120,11 +1100,9 @@ def try_create_growth(g):
11201100
ArithmeticError('Cannot build log(%s) in %s.' %
11211101
(self, self.parent())), e)
11221102

1123-
11241103
from .growth_group import _rpow_
11251104
rpow = _rpow_
11261105

1127-
11281106
def _rpow_element_(self, base):
11291107
r"""
11301108
Return an element which is the power of ``base`` to this
@@ -1166,7 +1144,6 @@ def _rpow_element_(self, base):
11661144
raise ValueError # calling method has to deal with it...
11671145
return factor._rpow_element_(base)
11681146

1169-
11701147
def exp(self):
11711148
r"""
11721149
The exponential of this element.
@@ -1211,7 +1188,6 @@ def exp(self):
12111188
"""
12121189
return self.rpow('e')
12131190

1214-
12151191
def __invert__(self):
12161192
r"""
12171193
Return the multiplicative inverse of this Cartesian product.
@@ -1235,7 +1211,6 @@ def __invert__(self):
12351211
return self.parent()._create_element_in_extension_(
12361212
tuple(~x for x in self.cartesian_factors()))
12371213

1238-
12391214
def _substitute_(self, rules):
12401215
r"""
12411216
Substitute the given ``rules`` in this
@@ -1378,7 +1353,6 @@ def _singularity_analysis_(self, var, zeta, precision):
13781353
'singularity analysis of {} not yet implemented '
13791354
'since it has more than two factors'.format(self))
13801355

1381-
13821356
def variable_names(self):
13831357
r"""
13841358
Return the names of the variables of this growth element.
@@ -1408,7 +1382,6 @@ def variable_names(self):
14081382
from itertools import groupby
14091383
return tuple(v for v, _ in groupby(vars))
14101384

1411-
14121385
CartesianProduct = CartesianProductGrowthGroups
14131386

14141387

src/sage/rings/asymptotic/term_monoid.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4640,7 +4640,6 @@ def __init__(self, parent, growth, valid_from, **kwds):
46404640
raise ValueError('B-Term has not defined all variables which occur in the term in valid_from.')
46414641
self.valid_from = valid_from
46424642

4643-
46444643
def construction(self):
46454644
r"""
46464645
Return a construction of this term.

src/sage/rings/continued_fraction.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,8 +1018,6 @@ def __bool__(self):
10181018
"""
10191019
return bool(self.quotient(0)) or self.quotient(1) is not Infinity
10201020

1021-
1022-
10231021
def is_zero(self):
10241022
r"""
10251023
Test whether ``self`` is zero.

src/sage/rings/function_field/ideal_polymod.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ def __bool__(self):
118118
"""
119119
return self._hnf.nrows() != 0
120120

121-
122-
123121
def __hash__(self):
124122
"""
125123
Return the hash of this ideal.

0 commit comments

Comments
 (0)