Skip to content

Commit

Permalink
autopep8 --in-place --ignore E402 --max-line-length=88 src/sage/**/al…
Browse files Browse the repository at this point in the history
…l*.py
  • Loading branch information
Matthias Koeppe committed Nov 12, 2023
1 parent 3b89a86 commit fb162de
Show file tree
Hide file tree
Showing 74 changed files with 461 additions and 425 deletions.
4 changes: 2 additions & 2 deletions src/sage/algebras/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Algebras
"""

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

from sage.algebras.all__sagemath_modules import *
from sage.algebras.all__sagemath_combinat import *
Expand Down
6 changes: 3 additions & 3 deletions src/sage/algebras/lie_algebras/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Lie Algebras
"""

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

lazy_import('sage.algebras.lie_algebras.lie_algebra', 'LieAlgebra')
#from kac_moody import KacMoodyAlgebra
# from kac_moody import KacMoodyAlgebra
lazy_import('sage.algebras.lie_algebras', 'examples', 'lie_algebras')
del lazy_import
10 changes: 6 additions & 4 deletions src/sage/algebras/lie_conformal_algebras/all.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#******************************************************************************
# ******************************************************************************
# Copyright (C) 2020 Reimundo Heluani <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
#*****************************************************************************
# *****************************************************************************


from sage.misc.lazy_import import lazy_import
lazy_import('sage.algebras.lie_conformal_algebras.lie_conformal_algebra','LieConformalAlgebra')
lazy_import('sage.algebras.lie_conformal_algebras', 'examples', 'lie_conformal_algebras')
lazy_import('sage.algebras.lie_conformal_algebras.lie_conformal_algebra',
'LieConformalAlgebra')
lazy_import('sage.algebras.lie_conformal_algebras',
'examples', 'lie_conformal_algebras')
del lazy_import
115 changes: 61 additions & 54 deletions src/sage/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,96 +59,97 @@

################ end setup warnings ###############################

from sage.all__sagemath_repl import * # includes .all__sagemath_objects, .all__sagemath_environment
# includes .all__sagemath_objects, .all__sagemath_environment
from sage.all__sagemath_repl import *

###################################################################

# This import also sets up the interrupt handler
from cysignals.signals import (AlarmInterrupt, SignalError,
sig_on_reset as sig_on_count)
sig_on_reset as sig_on_count)

from time import sleep
from time import sleep
from functools import reduce # in order to keep reduce in python3

import sage.misc.lazy_import

from sage.misc.all import * # takes a while
from sage.typeset.all import *
from sage.misc.all import * # takes a while
from sage.typeset.all import *

from sage.misc.sh import sh

from sage.libs.all import *
from sage.libs.all import *
from sage.data_structures.all import *

from sage.structure.all import *
from sage.rings.all import *
from sage.arith.all import *
from sage.matrix.all import *

from sage.symbolic.all import *
from sage.modules.all import *
from sage.monoids.all import *
from sage.algebras.all import *
from sage.modular.all import *
from sage.sat.all import *
from sage.schemes.all import *
from sage.graphs.all import *
from sage.groups.all import *
from sage.arith.power import generic_power as power
from sage.databases.all import *
from sage.structure.all import *
from sage.rings.all import *
from sage.arith.all import *
from sage.matrix.all import *

from sage.symbolic.all import *
from sage.modules.all import *
from sage.monoids.all import *
from sage.algebras.all import *
from sage.modular.all import *
from sage.sat.all import *
from sage.schemes.all import *
from sage.graphs.all import *
from sage.groups.all import *
from sage.arith.power import generic_power as power
from sage.databases.all import *
from sage.categories.all import *
from sage.sets.all import *
from sage.sets.all import *
from sage.probability.all import *
from sage.interfaces.all import *

from sage.functions.all import *
from sage.calculus.all import *
from sage.functions.all import *
from sage.calculus.all import *

lazy_import('sage.tests', 'all', as_='tests', deprecation=27337)
from sage.cpython.all import *
from sage.cpython.all import *

from sage.crypto.all import *
from sage.crypto.all import *
import sage.crypto.mq as mq

from sage.plot.all import *
from sage.plot.plot3d.all import *
from sage.plot.all import *
from sage.plot.plot3d.all import *

from sage.coding.all import *
from sage.combinat.all import *
from sage.coding.all import *
from sage.combinat.all import *

from sage.lfunctions.all import *

from sage.geometry.all import *
from sage.geometry.triangulation.all import *
from sage.geometry.riemannian_manifolds.all import *
from sage.geometry.all import *
from sage.geometry.triangulation.all import *
from sage.geometry.riemannian_manifolds.all import *

from sage.dynamics.all import *
from sage.dynamics.all import *

from sage.homology.all import *
from sage.homology.all import *

from sage.topology.all import *
from sage.topology.all import *

from sage.quadratic_forms.all import *

from sage.games.all import *
from sage.games.all import *

from sage.logic.all import *
from sage.logic.all import *

from sage.numerical.all import *
from sage.numerical.all import *

from sage.stats.all import *
from sage.stats.all import *
import sage.stats.all as stats

from sage.parallel.all import *
from sage.parallel.all import *

from sage.ext.fast_callable import fast_callable
from sage.ext.fast_eval import fast_float
from sage.ext.fast_callable import fast_callable
from sage.ext.fast_eval import fast_float

from sage.sandpiles.all import *

from sage.tensor.all import *
from sage.tensor.all import *

from sage.matroids.all import *
from sage.matroids.all import *

from sage.game_theory.all import *

Expand All @@ -168,7 +169,7 @@
_init_qqbar()

###########################################################
#### WARNING:
# WARNING:
# DO *not* import numpy / matplotlib / networkx here!!
# Each takes a surprisingly long time to initialize,
# and that initialization should be done more on-the-fly
Expand All @@ -190,31 +191,37 @@
copying = license
copyright = license


def quit_sage(verbose=True):
"""
Does nothing. Code that needs cleanup should register its own
handler using the atexit module.
"""
from sage.misc.superseded import deprecation
deprecation(8784, 'quit_sage is deprecated and now does nothing; please simply delete it')
deprecation(
8784, 'quit_sage is deprecated and now does nothing; please simply delete it')


from sage.misc.persist import register_unpickle_override
register_unpickle_override('sage.categories.category', 'Sets', Sets)
register_unpickle_override('sage.categories.category_types', 'HeckeModules', HeckeModules)
register_unpickle_override('sage.categories.category_types',
'HeckeModules', HeckeModules)
register_unpickle_override('sage.categories.category_types', 'Objects', Objects)
register_unpickle_override('sage.categories.category_types', 'Rings', Rings)
register_unpickle_override('sage.categories.category_types', 'Fields', Fields)
register_unpickle_override('sage.categories.category_types', 'VectorSpaces', VectorSpaces)
register_unpickle_override('sage.categories.category_types', 'Schemes_over_base', sage.categories.schemes.Schemes_over_base)
register_unpickle_override('sage.categories.category_types', 'ModularAbelianVarieties', ModularAbelianVarieties)
register_unpickle_override('sage.categories.category_types',
'VectorSpaces', VectorSpaces)
register_unpickle_override('sage.categories.category_types',
'Schemes_over_base', sage.categories.schemes.Schemes_over_base)
register_unpickle_override('sage.categories.category_types',
'ModularAbelianVarieties', ModularAbelianVarieties)
register_unpickle_override('sage.libs.pari.gen_py', 'pari', pari)

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


### Debugging for Singular, see trac #10903
# Debugging for Singular, see trac #10903
# from sage.libs.singular.ring import poison_currRing
# sys.settrace(poison_currRing)

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


### Python broke large ints; see trac #34506
# Python broke large ints; see trac #34506

if hasattr(sys, "set_int_max_str_digits"):
sys.set_int_max_str_digits(0)
Expand Down
12 changes: 6 additions & 6 deletions src/sage/all__sagemath_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

# This import also sets up the interrupt handler
from cysignals.signals import (AlarmInterrupt, SignalError,
sig_on_reset as sig_on_count)
sig_on_reset as sig_on_count)

from time import sleep
from time import sleep

from sage.misc.all__sagemath_objects import *
from sage.structure.all import *
from sage.arith.power import generic_power as power
from sage.misc.all__sagemath_objects import *
from sage.structure.all import *
from sage.arith.power import generic_power as power
from sage.categories.all__sagemath_objects import *

from sage.cpython.all import *
from sage.cpython.all import *

from cysignals.alarm import alarm, cancel_alarm

Expand Down
31 changes: 16 additions & 15 deletions src/sage/all__sagemath_repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import sys
import warnings

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

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

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

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

# Ignore Python 3.9 deprecation warnings
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='ast')
module='ast')

# Ignore packaging 20.5 deprecation warnings
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='(.*[.]_vendor[.])?packaging')
module='(.*[.]_vendor[.])?packaging')

# Ignore a few warnings triggered by pythran 0.12.1
warnings.filterwarnings('ignore', category=DeprecationWarning,
message='\n\n `numpy.distutils` is deprecated since NumPy 1.23.0',
module='pythran.dist')
message='\n\n `numpy.distutils` is deprecated since NumPy 1.23.0',
module='pythran.dist')
warnings.filterwarnings('ignore', category=DeprecationWarning,
message='pkg_resources is deprecated as an API|'
'Deprecated call to `pkg_resources.declare_namespace(.*)`',
module='pkg_resources|setuptools.sandbox')
message='pkg_resources is deprecated as an API|'
'Deprecated call to `pkg_resources.declare_namespace(.*)`',
module='pkg_resources|setuptools.sandbox')
warnings.filterwarnings('ignore', category=DeprecationWarning,
message='msvccompiler is deprecated and slated to be removed',
module='distutils.msvccompiler')
message='msvccompiler is deprecated and slated to be removed',
module='distutils.msvccompiler')

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

from sage.doctest.all import *
from sage.repl.all import *
from sage.doctest.all import *
from sage.repl.all import *
from sage.misc.all__sagemath_repl import *

# For doctesting. These are overwritten later
Expand Down
2 changes: 1 addition & 1 deletion src/sage/all_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from sage.misc.lazy_import import lazy_import

for pkg in ['axiom', 'fricas', 'gap' , 'gap3', 'giac', 'gp',
for pkg in ['axiom', 'fricas', 'gap', 'gap3', 'giac', 'gp',
'gnuplot', 'kash', 'magma', 'macaulay2', 'maple',
'mathematica', 'mathics', 'matlab',
'mupad', 'mwrank', 'octave', 'qepcad', 'singular',
Expand Down
Loading

0 comments on commit fb162de

Please sign in to comment.