Skip to content

Commit fb162de

Browse files
author
Matthias Koeppe
committed
autopep8 --in-place --ignore E402 --max-line-length=88 src/sage/**/all*.py
1 parent 3b89a86 commit fb162de

File tree

74 files changed

+461
-425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+461
-425
lines changed

src/sage/algebras/all.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Algebras
33
"""
44

5-
#*****************************************************************************
5+
# *****************************************************************************
66
# Copyright (C) 2005 William Stein <[email protected]>
77
#
88
# Distributed under the terms of the GNU General Public License (GPL)
@@ -15,7 +15,7 @@
1515
# The full text of the GPL is available at:
1616
#
1717
# http://www.gnu.org/licenses/
18-
#*****************************************************************************
18+
# *****************************************************************************
1919

2020
from sage.algebras.all__sagemath_modules import *
2121
from sage.algebras.all__sagemath_combinat import *

src/sage/algebras/lie_algebras/all.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Lie Algebras
33
"""
44

5-
#*****************************************************************************
5+
# *****************************************************************************
66
# Copyright (C) 2013 Travis Scrimshaw <tscrim at ucdavis.edu>
77
#
88
# Distributed under the terms of the GNU General Public License (GPL)
@@ -15,10 +15,10 @@
1515
# The full text of the GPL is available at:
1616
#
1717
# http://www.gnu.org/licenses/
18-
#*****************************************************************************
18+
# *****************************************************************************
1919
from sage.misc.lazy_import import lazy_import
2020

2121
lazy_import('sage.algebras.lie_algebras.lie_algebra', 'LieAlgebra')
22-
#from kac_moody import KacMoodyAlgebra
22+
# from kac_moody import KacMoodyAlgebra
2323
lazy_import('sage.algebras.lie_algebras', 'examples', 'lie_algebras')
2424
del lazy_import
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
#******************************************************************************
1+
# ******************************************************************************
22
# Copyright (C) 2020 Reimundo Heluani <[email protected]>
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
66
# the Free Software Foundation, either version 2 of the License, or
77
# (at your option) any later version.
88
# http://www.gnu.org/licenses/
9-
#*****************************************************************************
9+
# *****************************************************************************
1010

1111

1212
from sage.misc.lazy_import import lazy_import
13-
lazy_import('sage.algebras.lie_conformal_algebras.lie_conformal_algebra','LieConformalAlgebra')
14-
lazy_import('sage.algebras.lie_conformal_algebras', 'examples', 'lie_conformal_algebras')
13+
lazy_import('sage.algebras.lie_conformal_algebras.lie_conformal_algebra',
14+
'LieConformalAlgebra')
15+
lazy_import('sage.algebras.lie_conformal_algebras',
16+
'examples', 'lie_conformal_algebras')
1517
del lazy_import

src/sage/all.py

Lines changed: 61 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -59,96 +59,97 @@
5959

6060
################ end setup warnings ###############################
6161

62-
from sage.all__sagemath_repl import * # includes .all__sagemath_objects, .all__sagemath_environment
62+
# includes .all__sagemath_objects, .all__sagemath_environment
63+
from sage.all__sagemath_repl import *
6364

6465
###################################################################
6566

6667
# This import also sets up the interrupt handler
6768
from cysignals.signals import (AlarmInterrupt, SignalError,
68-
sig_on_reset as sig_on_count)
69+
sig_on_reset as sig_on_count)
6970

70-
from time import sleep
71+
from time import sleep
7172
from functools import reduce # in order to keep reduce in python3
7273

7374
import sage.misc.lazy_import
7475

75-
from sage.misc.all import * # takes a while
76-
from sage.typeset.all import *
76+
from sage.misc.all import * # takes a while
77+
from sage.typeset.all import *
7778

7879
from sage.misc.sh import sh
7980

80-
from sage.libs.all import *
81+
from sage.libs.all import *
8182
from sage.data_structures.all import *
8283

83-
from sage.structure.all import *
84-
from sage.rings.all import *
85-
from sage.arith.all import *
86-
from sage.matrix.all import *
87-
88-
from sage.symbolic.all import *
89-
from sage.modules.all import *
90-
from sage.monoids.all import *
91-
from sage.algebras.all import *
92-
from sage.modular.all import *
93-
from sage.sat.all import *
94-
from sage.schemes.all import *
95-
from sage.graphs.all import *
96-
from sage.groups.all import *
97-
from sage.arith.power import generic_power as power
98-
from sage.databases.all import *
84+
from sage.structure.all import *
85+
from sage.rings.all import *
86+
from sage.arith.all import *
87+
from sage.matrix.all import *
88+
89+
from sage.symbolic.all import *
90+
from sage.modules.all import *
91+
from sage.monoids.all import *
92+
from sage.algebras.all import *
93+
from sage.modular.all import *
94+
from sage.sat.all import *
95+
from sage.schemes.all import *
96+
from sage.graphs.all import *
97+
from sage.groups.all import *
98+
from sage.arith.power import generic_power as power
99+
from sage.databases.all import *
99100
from sage.categories.all import *
100-
from sage.sets.all import *
101+
from sage.sets.all import *
101102
from sage.probability.all import *
102103
from sage.interfaces.all import *
103104

104-
from sage.functions.all import *
105-
from sage.calculus.all import *
105+
from sage.functions.all import *
106+
from sage.calculus.all import *
106107

107108
lazy_import('sage.tests', 'all', as_='tests', deprecation=27337)
108-
from sage.cpython.all import *
109+
from sage.cpython.all import *
109110

110-
from sage.crypto.all import *
111+
from sage.crypto.all import *
111112
import sage.crypto.mq as mq
112113

113-
from sage.plot.all import *
114-
from sage.plot.plot3d.all import *
114+
from sage.plot.all import *
115+
from sage.plot.plot3d.all import *
115116

116-
from sage.coding.all import *
117-
from sage.combinat.all import *
117+
from sage.coding.all import *
118+
from sage.combinat.all import *
118119

119120
from sage.lfunctions.all import *
120121

121-
from sage.geometry.all import *
122-
from sage.geometry.triangulation.all import *
123-
from sage.geometry.riemannian_manifolds.all import *
122+
from sage.geometry.all import *
123+
from sage.geometry.triangulation.all import *
124+
from sage.geometry.riemannian_manifolds.all import *
124125

125-
from sage.dynamics.all import *
126+
from sage.dynamics.all import *
126127

127-
from sage.homology.all import *
128+
from sage.homology.all import *
128129

129-
from sage.topology.all import *
130+
from sage.topology.all import *
130131

131132
from sage.quadratic_forms.all import *
132133

133-
from sage.games.all import *
134+
from sage.games.all import *
134135

135-
from sage.logic.all import *
136+
from sage.logic.all import *
136137

137-
from sage.numerical.all import *
138+
from sage.numerical.all import *
138139

139-
from sage.stats.all import *
140+
from sage.stats.all import *
140141
import sage.stats.all as stats
141142

142-
from sage.parallel.all import *
143+
from sage.parallel.all import *
143144

144-
from sage.ext.fast_callable import fast_callable
145-
from sage.ext.fast_eval import fast_float
145+
from sage.ext.fast_callable import fast_callable
146+
from sage.ext.fast_eval import fast_float
146147

147148
from sage.sandpiles.all import *
148149

149-
from sage.tensor.all import *
150+
from sage.tensor.all import *
150151

151-
from sage.matroids.all import *
152+
from sage.matroids.all import *
152153

153154
from sage.game_theory.all import *
154155

@@ -168,7 +169,7 @@
168169
_init_qqbar()
169170

170171
###########################################################
171-
#### WARNING:
172+
# WARNING:
172173
# DO *not* import numpy / matplotlib / networkx here!!
173174
# Each takes a surprisingly long time to initialize,
174175
# and that initialization should be done more on-the-fly
@@ -190,31 +191,37 @@
190191
copying = license
191192
copyright = license
192193

194+
193195
def quit_sage(verbose=True):
194196
"""
195197
Does nothing. Code that needs cleanup should register its own
196198
handler using the atexit module.
197199
"""
198200
from sage.misc.superseded import deprecation
199-
deprecation(8784, 'quit_sage is deprecated and now does nothing; please simply delete it')
201+
deprecation(
202+
8784, 'quit_sage is deprecated and now does nothing; please simply delete it')
200203

201204

202205
from sage.misc.persist import register_unpickle_override
203206
register_unpickle_override('sage.categories.category', 'Sets', Sets)
204-
register_unpickle_override('sage.categories.category_types', 'HeckeModules', HeckeModules)
207+
register_unpickle_override('sage.categories.category_types',
208+
'HeckeModules', HeckeModules)
205209
register_unpickle_override('sage.categories.category_types', 'Objects', Objects)
206210
register_unpickle_override('sage.categories.category_types', 'Rings', Rings)
207211
register_unpickle_override('sage.categories.category_types', 'Fields', Fields)
208-
register_unpickle_override('sage.categories.category_types', 'VectorSpaces', VectorSpaces)
209-
register_unpickle_override('sage.categories.category_types', 'Schemes_over_base', sage.categories.schemes.Schemes_over_base)
210-
register_unpickle_override('sage.categories.category_types', 'ModularAbelianVarieties', ModularAbelianVarieties)
212+
register_unpickle_override('sage.categories.category_types',
213+
'VectorSpaces', VectorSpaces)
214+
register_unpickle_override('sage.categories.category_types',
215+
'Schemes_over_base', sage.categories.schemes.Schemes_over_base)
216+
register_unpickle_override('sage.categories.category_types',
217+
'ModularAbelianVarieties', ModularAbelianVarieties)
211218
register_unpickle_override('sage.libs.pari.gen_py', 'pari', pari)
212219

213220
# Cache the contents of star imports.
214221
sage.misc.lazy_import.save_cache_file()
215222

216223

217-
### Debugging for Singular, see trac #10903
224+
# Debugging for Singular, see trac #10903
218225
# from sage.libs.singular.ring import poison_currRing
219226
# sys.settrace(poison_currRing)
220227

@@ -241,7 +248,7 @@ def quit_sage(verbose=True):
241248
sage.misc.lazy_import.finish_startup()
242249

243250

244-
### Python broke large ints; see trac #34506
251+
# Python broke large ints; see trac #34506
245252

246253
if hasattr(sys, "set_int_max_str_digits"):
247254
sys.set_int_max_str_digits(0)

src/sage/all__sagemath_objects.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99

1010
# This import also sets up the interrupt handler
1111
from cysignals.signals import (AlarmInterrupt, SignalError,
12-
sig_on_reset as sig_on_count)
12+
sig_on_reset as sig_on_count)
1313

14-
from time import sleep
14+
from time import sleep
1515

16-
from sage.misc.all__sagemath_objects import *
17-
from sage.structure.all import *
18-
from sage.arith.power import generic_power as power
16+
from sage.misc.all__sagemath_objects import *
17+
from sage.structure.all import *
18+
from sage.arith.power import generic_power as power
1919
from sage.categories.all__sagemath_objects import *
2020

21-
from sage.cpython.all import *
21+
from sage.cpython.all import *
2222

2323
from cysignals.alarm import alarm, cancel_alarm
2424

src/sage/all__sagemath_repl.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import sys
33
import warnings
44

5-
__with_pydebug = hasattr(sys, 'gettotalrefcount') # This is a Python debug build (--with-pydebug)
5+
# This is a Python debug build (--with-pydebug)
6+
__with_pydebug = hasattr(sys, 'gettotalrefcount')
67
if __with_pydebug:
78
# a debug build does not install the default warning filters. Sadly, this breaks doctests so we
89
# have to re-add them:
@@ -16,38 +17,38 @@
1617

1718
# Ignore all deprecations from IPython etc.
1819
warnings.filterwarnings('ignore', category=DeprecationWarning,
19-
module='(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic|jedi)')
20+
module='(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic|jedi)')
2021

2122
# scipy 1.18 introduced reprecation warnings on a number of things they are moving to
2223
# numpy, e.g. DeprecationWarning: scipy.array is deprecated
2324
# and will be removed in SciPy 2.0.0, use numpy.array instead
2425
# This affects networkx 2.2 up and including 2.4 (cf. :trac:29766)
2526
warnings.filterwarnings('ignore', category=DeprecationWarning,
26-
module='(scipy|networkx)')
27+
module='(scipy|networkx)')
2728

2829
# However, be sure to keep OUR deprecation warnings
2930
warnings.filterwarnings('default', category=DeprecationWarning,
30-
message=r'[\s\S]*See https?://trac\.sagemath\.org/[0-9]* for details.')
31+
message=r'[\s\S]*See https?://trac\.sagemath\.org/[0-9]* for details.')
3132

3233
# Ignore Python 3.9 deprecation warnings
3334
warnings.filterwarnings('ignore', category=DeprecationWarning,
34-
module='ast')
35+
module='ast')
3536

3637
# Ignore packaging 20.5 deprecation warnings
3738
warnings.filterwarnings('ignore', category=DeprecationWarning,
38-
module='(.*[.]_vendor[.])?packaging')
39+
module='(.*[.]_vendor[.])?packaging')
3940

4041
# Ignore a few warnings triggered by pythran 0.12.1
4142
warnings.filterwarnings('ignore', category=DeprecationWarning,
42-
message='\n\n `numpy.distutils` is deprecated since NumPy 1.23.0',
43-
module='pythran.dist')
43+
message='\n\n `numpy.distutils` is deprecated since NumPy 1.23.0',
44+
module='pythran.dist')
4445
warnings.filterwarnings('ignore', category=DeprecationWarning,
45-
message='pkg_resources is deprecated as an API|'
46-
'Deprecated call to `pkg_resources.declare_namespace(.*)`',
47-
module='pkg_resources|setuptools.sandbox')
46+
message='pkg_resources is deprecated as an API|'
47+
'Deprecated call to `pkg_resources.declare_namespace(.*)`',
48+
module='pkg_resources|setuptools.sandbox')
4849
warnings.filterwarnings('ignore', category=DeprecationWarning,
49-
message='msvccompiler is deprecated and slated to be removed',
50-
module='distutils.msvccompiler')
50+
message='msvccompiler is deprecated and slated to be removed',
51+
module='distutils.msvccompiler')
5152

5253
warnings.filterwarnings('ignore', category=DeprecationWarning,
5354
message='The distutils(.sysconfig module| package) is deprecated',
@@ -100,8 +101,8 @@
100101
from sage.all__sagemath_objects import *
101102
from sage.all__sagemath_environment import *
102103

103-
from sage.doctest.all import *
104-
from sage.repl.all import *
104+
from sage.doctest.all import *
105+
from sage.repl.all import *
105106
from sage.misc.all__sagemath_repl import *
106107

107108
# For doctesting. These are overwritten later

src/sage/all_cmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
from sage.misc.lazy_import import lazy_import
2121

22-
for pkg in ['axiom', 'fricas', 'gap' , 'gap3', 'giac', 'gp',
22+
for pkg in ['axiom', 'fricas', 'gap', 'gap3', 'giac', 'gp',
2323
'gnuplot', 'kash', 'magma', 'macaulay2', 'maple',
2424
'mathematica', 'mathics', 'matlab',
2525
'mupad', 'mwrank', 'octave', 'qepcad', 'singular',

0 commit comments

Comments
 (0)