Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #29072: unused import cleaning ticket (partial)
Browse files Browse the repository at this point in the history
URL: https://trac.sagemath.org/29072
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Jori Mäntysalo
  • Loading branch information
Release Manager committed Jan 25, 2020
2 parents 7cec05e + 4f36353 commit fb9218e
Show file tree
Hide file tree
Showing 19 changed files with 50 additions and 86 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=029fe778cefcb82231353c0dab72a75769ffdcf9
md5=b4231b3e4ce67fc656ba9532b123485a
cksum=3808756319
sha1=eba2525f10654628b49962c62bfc59af6ded2f1c
md5=afb0bae9edcef8a014beb53c98ed1ab1
cksum=4189789818
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4fd5d56ecea2c81d58e9e43bd5f07b05e863bc7c
8dbd859f8ef6366440034215ccd7f49ab5687522
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
"""
from __future__ import absolute_import

#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2011 Johan Bosman <johan.g.bosman@gmail.com>
# Copyright (C) 2011, 2013 Peter Bruin <peter.bruin@math.uzh.ch>
#
# Distributed under the terms of the GNU General Public License (GPL)
# 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/
#*****************************************************************************
# https://www.gnu.org/licenses/
# ****************************************************************************

from .finite_dimensional_algebra_element import FiniteDimensionalAlgebraElement

from sage.matrix.constructor import Matrix
from sage.structure.element import is_Matrix
from sage.rings.ideal import Ideal_generic
from sage.structure.element import parent
from sage.structure.sage_object import SageObject

from sage.misc.cachefunc import cached_method
from functools import reduce
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
Morphisms Between Finite Algebras
"""

#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2011 Johan Bosman <johan.g.bosman@gmail.com>
# Copyright (C) 2011, 2013 Peter Bruin <peter.bruin@math.uzh.ch>
#
# Distributed under the terms of the GNU General Public License (GPL)
# 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/
#*****************************************************************************
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.misc.cachefunc import cached_method
from sage.categories.homset import Hom
from sage.rings.morphism import RingHomomorphism_im_gens
from sage.rings.homset import RingHomset_generic
from sage.matrix.constructor import matrix
from sage.structure.element import is_Matrix


class FiniteDimensionalAlgebraMorphism(RingHomomorphism_im_gens):
"""
Create a morphism between two :class:`finite-dimensional algebras <FiniteDimensionalAlgebra>`.
Expand Down
7 changes: 3 additions & 4 deletions src/sage/combinat/cartesian_product.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
r"""
Cartesian Products
"""
#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2007 Mike Hansen <mhansen@gmail.com>,
#
# Distributed under the terms of the GNU General Public License (GPL)
Expand All @@ -13,8 +13,8 @@
#
# The full text of the GPL is available at:
#
# http://www.gnu.org/licenses/
#*****************************************************************************
# https://www.gnu.org/licenses/
# ****************************************************************************
from __future__ import absolute_import

from six.moves import range
Expand All @@ -25,7 +25,6 @@
from inspect import isgenerator
import sage.misc.prandom as rnd
from sage.misc.mrange import xmrange_iter, _is_finite, _len
from .combinat import CombinatorialClass
from .ranker import unrank
from sage.rings.infinity import infinity

Expand Down
1 change: 0 additions & 1 deletion src/sage/combinat/free_dendriform_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.cachefunc import cached_method
from sage.sets.family import Family
from sage.misc.lazy_import import lazy_import
from sage.structure.coerce_exceptions import CoercionException


Expand Down
3 changes: 1 addition & 2 deletions src/sage/doctest/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import doctest
from Cython.Utils import is_package_dir
from sage.cpython.string import bytes_to_str
from sage.repl.preparse import preparse
from sage.repl.load import load
from sage.misc.lazy_attribute import lazy_attribute
from .parsing import SageDocTestParser
Expand Down Expand Up @@ -110,6 +109,7 @@ def get_basename(path):
fully_qualified_path = fully_qualified_path[:-9]
return fully_qualified_path.replace(os.path.sep, '.')


class DocTestSource(object):
"""
This class provides a common base class for different sources of doctests.
Expand Down Expand Up @@ -278,7 +278,6 @@ def _create_doctests(self, namespace, tab_okay=None):
self.linking = False
doctests = []
in_docstring = False
tab_found = False
unparsed_doc = False
doc = []
start = None
Expand Down
12 changes: 4 additions & 8 deletions src/sage/dynamics/finite_dynamical_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
knows the latter part of the Sage library well.
"""
#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2018 Darij Grinberg <darijgrinberg@gmail.com>,
# 2018 Tom Roby <tomrobyuconn@gmail.com>
#
Expand All @@ -85,18 +85,14 @@
#
# The full text of the GPL is available at:
#
# http://www.gnu.org/licenses/
#*****************************************************************************
#from sage.categories.enumerated_sets import EnumeratedSets
#from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
#from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
#from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
# https://www.gnu.org/licenses/
# ****************************************************************************
from six import add_metaclass
from sage.categories.sets_cat import Sets
from sage.misc.abstract_method import abstract_method
from sage.structure.sage_object import SageObject
from sage.misc.classcall_metaclass import ClasscallMetaclass, typecall


@add_metaclass(ClasscallMetaclass)
class DiscreteDynamicalSystem(SageObject):
r"""
Expand Down
4 changes: 2 additions & 2 deletions src/sage/groups/abelian_gps/abelian_aut.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@
# 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/
# https://www.gnu.org/licenses/
# ****************************************************************************
from sage.categories.groups import Groups
from sage.groups.abelian_gps.abelian_group_gap import AbelianGroup_gap
from sage.groups.group import Group
from sage.groups.libgap_wrapper import ParentLibGAP, ElementLibGAP
from sage.groups.libgap_mixin import GroupMixinLibGAP
from sage.libs.gap.element import GapElement
from sage.libs.gap.libgap import libgap
from sage.matrix.matrix_space import MatrixSpace
from sage.rings.all import ZZ
from sage.structure.unique_representation import UniqueRepresentation


class AbelianGroupAutomorphism(ElementLibGAP):
"""
Automorphisms of abelian groups with gap.
Expand Down
12 changes: 4 additions & 8 deletions src/sage/groups/abelian_gps/abelian_group_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@
# Copyright (C) 2012 Volker Braun <vbraun.name@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
# https://www.gnu.org/licenses/
###########################################################################


from sage.rings.integer import Integer
from sage.rings.infinity import infinity
from sage.arith.all import LCM, GCD
from sage.groups.abelian_gps.element_base import AbelianGroupElementBase


def is_AbelianGroupElement(x):
"""
Return true if x is an abelian group element, i.e., an element of
Expand Down Expand Up @@ -112,7 +109,6 @@ def as_permutation(self):
sage: ap in Gp
True
"""
from sage.groups.perm_gps.permgroup import PermutationGroup
from sage.interfaces.all import gap
G = self.parent()
invs = list(G.gens_orders())
Expand Down Expand Up @@ -162,5 +158,5 @@ def word_problem(self, words):
sage: prod([x^i for x,i in v]) == y*x
True
"""
from sage.groups.abelian_gps.abelian_group import AbelianGroup, word_problem
return word_problem(words,self)
from sage.groups.abelian_gps.abelian_group import word_problem
return word_problem(words, self)
2 changes: 0 additions & 2 deletions src/sage/groups/affine_gps/euclidean_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# https://www.gnu.org/licenses/
##############################################################################

from sage.matrix.all import MatrixSpace
from sage.modules.all import FreeModule
from sage.groups.affine_gps.affine_group import AffineGroup


Expand Down
10 changes: 2 additions & 8 deletions src/sage/groups/finitely_presented.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,24 @@
- Miguel Angel Marco Buzunariz
"""

#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2012 Miguel Angel Marco Buzunariz <mmarco@unizar.es>
#
# 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.
# https://www.gnu.org/licenses/
#*****************************************************************************
# ****************************************************************************

from sage.groups.group import Group
from sage.groups.libgap_wrapper import ParentLibGAP, ElementLibGAP
from sage.groups.libgap_mixin import GroupMixinLibGAP
from sage.structure.unique_representation import UniqueRepresentation
from sage.libs.gap.libgap import libgap
from sage.libs.gap.element import GapElement
from sage.rings.integer import Integer
from sage.rings.integer_ring import IntegerRing
from sage.misc.cachefunc import cached_method
from sage.groups.free_group import FreeGroupElement

from sage.structure.element import MultiplicativeGroupElement
from sage.interfaces.gap import gap
from sage.functions.generalized import sign
from sage.matrix.constructor import matrix
from sage.categories.morphism import SetMorphism
Expand Down Expand Up @@ -1395,7 +1390,6 @@ def simplification_isomorphism(self):
Uses GAP.
"""
I = self.gap().IsomorphismSimplifiedFpGroup()
domain = self
codomain = wrap_FpGroup(I.Range())
phi = lambda x: codomain(I.ImageElm(x.gap()))
HS = self.Hom(codomain)
Expand Down
3 changes: 1 addition & 2 deletions src/sage/groups/indexed_free_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
from sage.categories.poor_man_map import PoorManMap
from sage.groups.group import Group, AbelianGroup
from sage.monoids.indexed_free_monoid import (IndexedMonoid,
IndexedMonoidElement, IndexedFreeMonoidElement,
IndexedFreeAbelianMonoidElement)
IndexedFreeMonoidElement, IndexedFreeAbelianMonoidElement)
from sage.misc.cachefunc import cached_method
import sage.data_structures.blas_dict as blas
from sage.rings.integer import Integer
Expand Down
3 changes: 1 addition & 2 deletions src/sage/repl/rich_output/backend_sagenb.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
# Distributed under the terms of the GNU General Public License (GPL)
# 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/
# https://www.gnu.org/licenses/
#*****************************************************************************

import io
Expand All @@ -70,7 +70,6 @@
from sage.misc.cachefunc import cached_method
from sage.misc.html import html
from sage.misc.temporary_file import graphics_filename
from sage.doctest import DOCTEST_MODE
from sage.repl.rich_output.backend_base import BackendBase
from sage.repl.rich_output.output_catalog import *
from sage.repl.rich_output.output_video import OutputVideoBase
Expand Down
12 changes: 3 additions & 9 deletions src/sage/repl/rich_output/pretty_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,14 @@
sage: pretty_print(plot(sin))
"""


#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2015 Volker Braun <vbraun.name@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# 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/
#*****************************************************************************


import types
import collections

# https://www.gnu.org/licenses/
# ****************************************************************************
from sage.structure.sage_object import SageObject
from sage.repl.rich_output import get_display_manager

Expand Down
10 changes: 4 additions & 6 deletions src/sage/rings/padics/eisenstein_extension_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@
"""
from __future__ import absolute_import

#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2008 David Roe <roed.math@gmail.com>
# William Stein <wstein@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# 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/
#*****************************************************************************
# https://www.gnu.org/licenses/
# ****************************************************************************

from .padic_extension_generic import pAdicExtensionGeneric
from .misc import precprint
from sage.rings.infinity import infinity
from sage.misc.latex import latex
from sage.rings.integer import Integer


class EisensteinExtensionGeneric(pAdicExtensionGeneric):
def __init__(self, poly, prec, print_mode, names, element_class):
Expand Down
19 changes: 8 additions & 11 deletions src/sage/rings/polynomial/skew_polynomial_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@
doctest errors
"""

#############################################################################
# ***************************************************************************
# Copyright (C) 2012 Xavier Caruso <xavier.caruso@normalesup.org>
#
# 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/
#****************************************************************************
# https://www.gnu.org/licenses/
# ***************************************************************************

from __future__ import print_function, absolute_import, division

Expand All @@ -42,14 +41,12 @@
from sage.rings.ring import Algebra
from sage.categories.rings import Rings
from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.rings.ring import Field
from sage.structure.category_object import normalize_names
from sage.categories.morphism import Morphism
from sage.categories.morphism import IdentityMorphism
from sage.rings.polynomial.skew_polynomial_element import (SkewPolynomial,
SkewPolynomialBaseringInjection)
from sage.categories.morphism import Morphism, IdentityMorphism
from sage.rings.polynomial.skew_polynomial_element import SkewPolynomialBaseringInjection

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

def _base_ring_to_fraction_field(S):
"""
Expand Down Expand Up @@ -485,7 +482,7 @@ def _coerce_map_from_(self, P):
return False
if P.variable_name() == self.variable_name():
if (P.base_ring() is self.base_ring()
and self.base_ring() is ZZ_sage):
and self.base_ring() is ZZ):
if self._implementation_names == ('NTL',):
return False
return self.base_ring().has_coerce_map_from(P.base_ring())
Expand Down
Loading

0 comments on commit fb9218e

Please sign in to comment.