Ticket #13023: trac_13023_fix_circular_imports.patch

File trac_13023_fix_circular_imports.patch, 5.6 KB (added by Andrey Novoseltsev, 11 years ago)

Manual adjustment of imports

  • sage/schemes/generic/homset.py

    # HG changeset patch
    # User Andrey Novoseltsev <novoselt@gmail.com>
    # Date 1338058716 25200
    # Node ID 1d22efd70889913f9dd4341146d4a2ea57f5c9e5
    # Parent  ef2d3eb2e87ede1ee87869f3cd4d9ccf274c37c2
    Fix circular imports due to the move of toric varieties files.
    
    diff --git a/sage/schemes/generic/homset.py b/sage/schemes/generic/homset.py
    a b  
    4949    SchemeMorphism_point_affine,
    5050    SchemeMorphism_point_projective_ring,
    5151    SchemeMorphism_point_projective_field )
    52 from sage.schemes.toric.morphism import SchemeMorphism_point_toric_field
    53 
    54 
    5552
    5653
    5754def is_SchemeHomset(H):
     
    897894                           'SchemeHomsetModule_abelian_variety_coordinates_field',
    898895                           SchemeHomset_points_abelian_variety_field)
    899896
    900 #*******************************************************************
    901 # Toric varieties
    902 #*******************************************************************
    903 class SchemeHomset_points_toric_field(SchemeHomset_points):
    904     """
    905     Set of rational points of a toric variety.
    906 
    907     INPUT:
    908 
    909     - same as for :class:`SchemeHomset_points`.
    910 
    911     OUPUT:
    912 
    913     A scheme morphism of type
    914     :class:`SchemeHomset_points_toric_field`.
    915 
    916     EXAMPLES::
    917 
    918         sage: P1xP1 = toric_varieties.P1xP1()
    919         sage: P1xP1(QQ)
    920         Set of rational points of 2-d CPR-Fano toric variety
    921         covered by 4 affine patches
    922 
    923     TESTS::
    924 
    925         sage: import sage.schemes.generic.homset as HOM
    926         sage: HOM.SchemeHomset_points_toric_field(Spec(QQ), P1xP1)
    927         Set of rational points of 2-d CPR-Fano toric variety covered by 4 affine patches
    928     """
    929     pass
  • sage/schemes/toric/homset.py

    diff --git a/sage/schemes/toric/homset.py b/sage/schemes/toric/homset.py
    a b  
    7878from sage.matrix.matrix_space import MatrixSpace
    7979from sage.geometry.fan_morphism import FanMorphism
    8080
    81 from sage.schemes.generic.homset import SchemeHomset_generic
     81from sage.schemes.generic.homset import (SchemeHomset_generic,
     82                                         SchemeHomset_points)
    8283
    8384
    8485class SchemeHomset_toric_variety(SchemeHomset_generic):
     
    230231        raise TypeError, "x must be a fan morphism or a list/tuple of polynomials"
    231232
    232233
     234class SchemeHomset_points_toric_field(SchemeHomset_points):
     235    """
     236    Set of rational points of a toric variety.
    233237
     238    INPUT:
     239
     240    - same as for :class:`SchemeHomset_points`.
     241
     242    OUPUT:
     243
     244    A scheme morphism of type
     245    :class:`SchemeHomset_points_toric_field`.
     246
     247    EXAMPLES::
     248
     249        sage: P1xP1 = toric_varieties.P1xP1()
     250        sage: P1xP1(QQ)
     251        Set of rational points of 2-d CPR-Fano toric variety
     252        covered by 4 affine patches
     253
     254    TESTS::
     255
     256        sage: import sage.schemes.toric.homset as HOM
     257        sage: HOM.SchemeHomset_points_toric_field(Spec(QQ), P1xP1)
     258        Set of rational points of 2-d CPR-Fano toric variety covered by 4 affine patches
     259    """
     260    pass
  • sage/schemes/toric/library.py

    diff --git a/sage/schemes/toric/library.py b/sage/schemes/toric/library.py
    a b  
    4242from sage.geometry.fan import Fan
    4343from sage.geometry.lattice_polytope import LatticePolytope
    4444from sage.rings.all import ZZ
    45 from sage.schemes.toric.variety import ToricVariety
     45from sage.schemes.toric.variety import (DEFAULT_PREFIX,
     46                                        ToricVariety,
     47                                        normalize_names)
    4648from sage.schemes.toric.fano_variety import CPRFanoToricVariety
    4749
    4850
     
    211213        if coordinate_names is None:
    212214            dict_key = '_cached_'+name
    213215        else:
    214             import toric_variety
    215             coordinate_names = toric_variety.\
    216                 normalize_names(coordinate_names, len(rays), toric_variety.DEFAULT_PREFIX)
     216            coordinate_names = normalize_names(coordinate_names, len(rays),
     217                                               DEFAULT_PREFIX)
    217218            dict_key = '_cached_'+name+'_'+'_'.join(coordinate_names)
    218219        if dict_key not in self.__dict__:
    219220            fan = Fan(cones, rays, check=self._check)
     
    249250        if coordinate_names is None:
    250251            dict_key = '_cached_'+name
    251252        else:
    252             import toric_variety
    253             coordinate_names = toric_variety.\
    254                 normalize_names(coordinate_names, len(rays), toric_variety.DEFAULT_PREFIX)
     253            coordinate_names = normalize_names(coordinate_names, len(rays),
     254                                               DEFAULT_PREFIX)
    255255            dict_key = '_cached_'+name+'_'+'_'.join(coordinate_names)
    256256        if dict_key not in self.__dict__:
    257257            polytope = LatticePolytope( matrix(rays).transpose() )
  • sage/schemes/toric/variety.py

    diff --git a/sage/schemes/toric/variety.py b/sage/schemes/toric/variety.py
    a b  
    318318from sage.rings.all import PolynomialRing, ZZ, QQ, is_Field
    319319from sage.rings.quotient_ring_element import QuotientRingElement
    320320from sage.rings.quotient_ring import QuotientRing_generic
     321from sage.schemes.generic.affine_space import AffineSpace
    321322from sage.schemes.generic.ambient_space import AmbientSpace
    322 from sage.schemes.generic.homset import SchemeHomset_points_toric_field
     323from sage.schemes.toric.homset import SchemeHomset_points_toric_field
    323324
    324325
    325326
     
    26042605              1
    26052606        """
    26062607        R, I, dualcone = self._semigroup_ring(cone, names)
    2607         from affine_space import AffineSpace
    26082608        patch_cover = AffineSpace(R)
    26092609        patch = patch_cover.subscheme(I)
    26102610        return patch