Ticket #15293: trac_15293-lazy_import_combinat_stuff-nt.patch

File trac_15293-lazy_import_combinat_stuff-nt.patch, 11.5 KB (added by nthiery, 6 years ago)
  • sage/algebras/all.py

    # HG changeset patch
    # User Nicolas M. Thiery <nthiery@users.sf.net>
    # Date 1381942254 -7200
    # Node ID eb9ece18caab4359fc863d9165d74caa07e8a40a
    # Parent  d0016a80da7b1a5ee0c50aa6a194a1928678a9e9
    #15293: Lazy import root systems, crystals and other combinatorics features to save on startup time
    
    diff --git a/sage/algebras/all.py b/sage/algebras/all.py
    a b from steenrod.all import * 
    3434
    3535from group_algebra_new import GroupAlgebra
    3636
    37 from iwahori_hecke_algebra import IwahoriHeckeAlgebra, IwahoriHeckeAlgebraT
    38 from affine_nil_temperley_lieb import AffineNilTemperleyLiebTypeA
     37lazy_import('sage.algebras.iwahori_hecke_algebra', 'IwahoriHeckeAlgebra')
     38lazy_import('sage.algebras.iwahori_hecke_algebra', 'IwahoriHeckeAlgebraT')
     39lazy_import('sage.algebras.affine_nil_temperley_lieb', 'AffineNilTemperleyLiebTypeA')
    3940lazy_import('sage.algebras.nil_coxeter_algebra', 'NilCoxeterAlgebra')
    4041
    4142lazy_import('sage.algebras.shuffle_algebra', 'ShuffleAlgebra')
  • sage/combinat/all.py

    diff --git a/sage/combinat/all.py b/sage/combinat/all.py
    a b  
     1from sage.misc.lazy_import import lazy_import
     2
    13from combinat import *
    24from expnums import expnums
    35
    from yang_baxter_graph import YangBaxter 
    2325
    2426#Permutations
    2527from permutation import Permutation, Permutations, Arrangements, PermutationOptions, CyclicPermutations, CyclicPermutationsOfPartition
    26 from affine_permutation import AffinePermutationGroup
     28lazy_import('sage.combinat.affine_permutation', 'AffinePermutationGroup')
    2729from derangements import Derangements
    2830
    2931#RSK
    from alternating_sign_matrix import Alte 
    104106from non_decreasing_parking_function import NonDecreasingParkingFunctions, NonDecreasingParkingFunction
    105107from parking_functions import ParkingFunctions, ParkingFunction
    106108
    107 from ordered_tree import (OrderedTree, OrderedTrees,
    108                           LabelledOrderedTree, LabelledOrderedTrees)
    109 from binary_tree import (BinaryTree, BinaryTrees,
    110                          LabelledBinaryTree, LabelledBinaryTrees)
     109from sage.misc.lazy_import import lazy_import
     110lazy_import('sage.combinat.ordered_tree', 'OrderedTree')
     111lazy_import('sage.combinat.ordered_tree', 'OrderedTrees')
     112lazy_import('sage.combinat.ordered_tree', 'LabelledOrderedTree')
     113lazy_import('sage.combinat.ordered_tree', 'LabelledOrderedTrees')
     114lazy_import('sage.combinat.binary_tree', 'BinaryTree')
     115lazy_import('sage.combinat.binary_tree', 'BinaryTrees')
     116lazy_import('sage.combinat.binary_tree', 'LabelledBinaryTree')
     117lazy_import('sage.combinat.binary_tree', 'LabelledBinaryTrees')
    111118
    112119from combination import Combinations
    113120from cartesian_product import CartesianProduct
  • sage/combinat/crystals/all.py

    diff --git a/sage/combinat/crystals/all.py b/sage/combinat/crystals/all.py
    a b  
    1 from letters import CrystalOfLetters
    2 from spins import CrystalOfSpins
    3 from spins import CrystalOfSpinsPlus
    4 from spins import CrystalOfSpinsMinus
    5 from tensor_product import TensorProductOfCrystals
    6 from tensor_product import CrystalOfTableaux
    7 from kyoto_path_model import KyotoPathModel
    8 from fast_crystals import FastCrystal
    9 from affine import AffineCrystalFromClassical
    10 from affine import AffineCrystalFromClassicalAndPromotion
    11 from kirillov_reshetikhin import KirillovReshetikhinCrystal
    12 from highest_weight_crystals import HighestWeightCrystal
    13 from direct_sum import DirectSumOfCrystals
    14 from alcove_path import CrystalOfAlcovePaths
    15 from alcove_path import ClassicalCrystalOfAlcovePaths
    16 from littelmann_path import CrystalOfLSPaths, CrystalOfProjectedLevelZeroLSPaths
    17 from generalized_young_walls import InfinityCrystalOfGeneralizedYoungWalls, CrystalOfGeneralizedYoungWalls
    18 from infinity_crystals import InfinityCrystalOfTableaux
    19 from elementary_crystals import TCrystal, RCrystal, ElementaryCrystal, ComponentCrystal
    20 from monomial_crystals import InfinityCrystalOfNakajimaMonomials, CrystalOfNakajimaMonomials
     1from sage.misc.lazy_import import lazy_import
     2lazy_import('sage.combinat.crystals.letters', 'CrystalOfLetters')
     3lazy_import('sage.combinat.crystals.spins', 'CrystalOfSpins')
     4lazy_import('sage.combinat.crystals.spins', 'CrystalOfSpinsPlus')
     5lazy_import('sage.combinat.crystals.spins', 'CrystalOfSpinsMinus')
     6lazy_import('sage.combinat.crystals.tensor_product', 'TensorProductOfCrystals')
     7lazy_import('sage.combinat.crystals.tensor_product', 'CrystalOfTableaux')
     8lazy_import('sage.combinat.crystals.kyoto_path_model', 'KyotoPathModel')
     9lazy_import('sage.combinat.crystals.fast_crystals', 'FastCrystal')
     10lazy_import('sage.combinat.crystals.affine', 'AffineCrystalFromClassical')
     11lazy_import('sage.combinat.crystals.affine', 'AffineCrystalFromClassicalAndPromotion')
     12lazy_import('sage.combinat.crystals.kirillov_reshetikhin', 'KirillovReshetikhinCrystal')
     13lazy_import('sage.combinat.crystals.highest_weight_crystals', 'HighestWeightCrystal')
     14lazy_import('sage.combinat.crystals.direct_sum', 'DirectSumOfCrystals')
     15lazy_import('sage.combinat.crystals.alcove_path', 'CrystalOfAlcovePaths')
     16lazy_import('sage.combinat.crystals.alcove_path', 'ClassicalCrystalOfAlcovePaths')
     17lazy_import('sage.combinat.crystals.littelmann_path', 'CrystalOfLSPaths')
     18lazy_import('sage.combinat.crystals.littelmann_path', 'CrystalOfProjectedLevelZeroLSPaths')
     19lazy_import('sage.combinat.crystals.generalized_young_walls', 'InfinityCrystalOfGeneralizedYoungWalls')
     20lazy_import('sage.combinat.crystals.generalized_young_walls', 'CrystalOfGeneralizedYoungWalls')
     21lazy_import('sage.combinat.crystals.infinity_crystals', 'InfinityCrystalOfTableaux')
     22lazy_import('sage.combinat.crystals.elementary_crystals', 'TCrystal')
     23lazy_import('sage.combinat.crystals.elementary_crystals', 'RCrystal')
     24lazy_import('sage.combinat.crystals.elementary_crystals', 'ElementaryCrystal')
     25lazy_import('sage.combinat.crystals.elementary_crystals', 'ComponentCrystal')
     26lazy_import('sage.combinat.crystals.monomial_crystals', 'InfinityCrystalOfNakajimaMonomials')
     27lazy_import('sage.combinat.crystals.monomial_crystals', 'CrystalOfNakajimaMonomials')
  • sage/combinat/k_tableau.py

    diff --git a/sage/combinat/k_tableau.py b/sage/combinat/k_tableau.py
    a b from sage.structure.list_clone import Cl 
    4646from sage.misc.classcall_metaclass import ClasscallMetaclass
    4747from sage.combinat.skew_tableau import SkewTableau, SemistandardSkewTableaux
    4848from sage.combinat.partition import Partition, Partitions
    49 from sage.combinat.root_system.weyl_group import WeylGroup
     49from sage.misc.lazy_import import lazy_import
     50lazy_import('sage.combinat.root_system.weyl_group', 'WeylGroup')
    5051from sage.combinat.core import Core
    5152from sage.rings.all import ZZ
    5253from sage.misc.misc import uniq
  • sage/combinat/kazhdan_lusztig.py

    diff --git a/sage/combinat/kazhdan_lusztig.py b/sage/combinat/kazhdan_lusztig.py
    a b from sage.misc.cachefunc import cached_m 
    1515from sage.rings.polynomial.laurent_polynomial import LaurentPolynomial_mpair
    1616from sage.structure.sage_object import SageObject
    1717from sage.structure.unique_representation import UniqueRepresentation
    18 from sage.combinat.root_system.coxeter_group import CoxeterGroup
    1918
    2019class KazhdanLusztigPolynomial(UniqueRepresentation, SageObject):
    2120    """
  • sage/combinat/partition.py

    diff --git a/sage/combinat/partition.py b/sage/combinat/partition.py
    a b from sage.combinat.partitions import num 
    306306from sage.combinat.partitions import ZS1_iterator
    307307from sage.combinat.integer_vector import IntegerVectors
    308308from sage.combinat.integer_list import IntegerListsLex
    309 from sage.combinat.root_system.weyl_group import WeylGroup
    310309from sage.combinat.combinatorial_map import combinatorial_map
    311310
    312311from sage.groups.perm_gps.permgroup import PermutationGroup
    class Partition(CombinatorialObject, Ele 
    34103409            [0 1 0]
    34113410            [0 0 1]
    34123411        """
     3412        from sage.combinat.root_system.weyl_group import WeylGroup
    34133413        return WeylGroup(['A',k,1]).from_reduced_word(self.from_kbounded_to_reduced_word(k))
    34143414
    34153415    def to_list(self):
  • sage/combinat/rigged_configurations/all.py

    diff --git a/sage/combinat/rigged_configurations/all.py b/sage/combinat/rigged_configurations/all.py
    a b  
    1 from rigged_configurations import RiggedConfigurations
    2 from tensor_product_kr_tableaux import TensorProductOfKirillovReshetikhinTableaux
    3 from kr_tableaux import KirillovReshetikhinTableaux
     1from sage.misc.lazy_import import lazy_import
     2lazy_import('sage.combinat.rigged_configurations.rigged_configurations', 'RiggedConfigurations')
     3lazy_import('sage.combinat.rigged_configurations.tensor_product_kr_tableaux', 'TensorProductOfKirillovReshetikhinTableaux')
     4lazy_import('sage.combinat.rigged_configurations.kr_tableaux', 'KirillovReshetikhinTableaux')
    45
  • sage/combinat/root_system/__init__.py

    diff --git a/sage/combinat/root_system/__init__.py b/sage/combinat/root_system/__init__.py
    a b  
    11# Makes sage.combinat.root_system? equivalent to sage.combinat.root_system.root_system?
    2 from root_system import __doc__
    32
    4 # currently needed to activate the backward compatibility register_unpickle_override
    5 import type_A
    6 import type_B
    7 import type_C
    8 import type_D
    9 import type_E
    10 import type_F
    11 import type_G
     3# from root_system import __doc__
     4
     5# # currently needed to activate the backward compatibility register_unpickle_override
     6# import type_A
     7# import type_B
     8# import type_C
     9# import type_D
     10# import type_E
     11# import type_F
     12# import type_G
    1213
    1314import all
  • sage/combinat/root_system/all.py

    diff --git a/sage/combinat/root_system/all.py b/sage/combinat/root_system/all.py
    a b  
    11from sage.misc.lazy_import import lazy_import
    22lazy_import('sage.combinat.root_system.associahedron', 'Associahedron')
     3lazy_import('sage.combinat.root_system.cartan_type', 'CartanType')
     4lazy_import('sage.combinat.root_system.coxeter_group', 'CoxeterGroup')
     5lazy_import('sage.combinat.root_system.dynkin_diagram', 'DynkinDiagram')
     6lazy_import('sage.combinat.root_system.cartan_matrix', 'CartanMatrix')
     7lazy_import('sage.combinat.root_system.cartan_matrix', 'cartan_matrix')
     8lazy_import('sage.combinat.root_system.root_system', 'RootSystem')
     9lazy_import('sage.combinat.root_system.root_system', 'WeylDim')
     10lazy_import('sage.combinat.root_system.weyl_group', 'WeylGroup')
     11lazy_import('sage.combinat.root_system.weyl_group', 'WeylGroupElement')
     12lazy_import('sage.combinat.root_system.weyl_characters', 'WeylCharacterRing')
     13lazy_import('sage.combinat.root_system.weyl_characters', 'branch_weyl_character')
     14lazy_import('sage.combinat.root_system.weyl_characters', 'branching_rule_from_plethysm')
     15lazy_import('sage.combinat.root_system.weyl_characters', 'get_branching_rule')
     16lazy_import('sage.combinat.root_system.weyl_characters', 'WeightRing')
    317
    4 from cartan_type import CartanType
    5 from dynkin_diagram import DynkinDiagram
    6 from cartan_matrix import CartanMatrix, cartan_matrix
    7 from coxeter_matrix import coxeter_matrix
    8 from root_system import RootSystem, WeylDim
    9 from weyl_group import WeylGroup, WeylGroupElement
    10 from coxeter_group import CoxeterGroup
    11 from weyl_characters import WeylCharacterRing, branch_weyl_character, branching_rule_from_plethysm, get_branching_rule, WeightRing
    12 
  • sage/combinat/root_system/cartan_type.py

    diff --git a/sage/combinat/root_system/cartan_type.py b/sage/combinat/root_system/cartan_type.py
    a b  
     1print "coucou"
    12r"""
    23Cartan types
    34