[Sage] #14866: Lazy imports, NilCoxeterAlgebra, Hall-Littlewood Polynomials

3 views
Skip to first unread message

Sage

unread,
Jul 7, 2013, 5:41:22 PM7/7/13
to sage...@googlegroups.com
#14866: Lazy imports, NilCoxeterAlgebra, Hall-Littlewood Polynomials
-----------------------------+----------------------------------------------
Reporter: SimonKing | Owner: sage-combinat
Type: enhancement | Status: new
Priority: major | Milestone: sage-5.12
Component: combinatorics | Keywords:
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------------------------
Currently, at startup, algebras.all does `from nil_coxeter_algebra import
NilCoxeterAlgebra`,
which results in `import kfpoly` in combinat.sf.hall_littlewood in
line 32, which creates PolynomialRing(ZZ,'t').

This should be made more lazy; there is no reason to import HL polynomials
nor the NilCoxeterAlgebra at startup, *and* it would be nicer to not
create a polynomial ring upon importing HL polynomials.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14866>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, and MATLAB

Sage

unread,
Jul 8, 2013, 3:19:38 PM7/8/13
to sage...@googlegroups.com
#14866: Lazy imports, NilCoxeterAlgebra, Hall-Littlewood Polynomials
---------------------------------+------------------------------------------
Reporter: SimonKing | Owner: sage-combinat
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.12
Component: combinatorics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Changes (by chapoton):

* status: new => needs_review


Comment:

here is a patch, that hopefully does the job.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14866#comment:1>

Sage

unread,
Jul 12, 2013, 11:46:10 AM7/12/13
to sage...@googlegroups.com
#14866: Lazy imports, NilCoxeterAlgebra, Hall-Littlewood Polynomials
---------------------------------+------------------------------------------
Reporter: SimonKing | Owner: sage-combinat
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.12
Component: combinatorics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------

Comment (by chapoton):

ok, bot is happy, is there anybody for a review ?

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14866#comment:2>

Sage

unread,
Jul 13, 2013, 8:54:20 AM7/13/13
to sage...@googlegroups.com
#14866: Lazy imports, NilCoxeterAlgebra, Hall-Littlewood Polynomials
---------------------------------+------------------------------------------
Reporter: SimonKing | Owner: sage-combinat
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.12
Component: combinatorics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------

Comment (by tscrim):

By doing it this way, there is not a significant improvement to startup
time, even though all 3 modules are not imported at startup. Also what is
your criterion for lazily importing these three modules and not others
(such as the Jack symmetric functions)? It feels kind of arbitrary to me.

I think we should do the following:

- Move the import of `kfpoly.py` into the appropriate method (as per the
current patch)
- Remove the `global_t` in `kfpoly.py` which will remove the creation
(from `kfpoly.py` at least) of the poylnomial ring.
- Have a well-defined set of criterion for when we should lazily import
modules.

Best,[[BR]]
Travis

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14866#comment:3>

Sage

unread,
Jul 16, 2013, 12:45:21 PM7/16/13
to sage...@googlegroups.com
#14866: Lazy imports, NilCoxeterAlgebra, Hall-Littlewood Polynomials
---------------------------------+------------------------------------------
Reporter: SimonKing | Owner: sage-combinat
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.12
Component: combinatorics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------

Comment (by chapoton):

ok, I have (maybe) taken care of the global_t in kf_poly

concerning the policy for "lazy_import", I would vote for lazy_importing
everybody, but I do not understand if it is good or not for the starting
time.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14866#comment:4>

Sage

unread,
Jul 17, 2013, 4:09:20 PM7/17/13
to sage...@googlegroups.com
#14866: Lazy imports, NilCoxeterAlgebra, Hall-Littlewood Polynomials
-------------------------------------+--------------------------------------
Reporter: SimonKing | Owner: sage-combinat
Type: enhancement | Status: positive_review
Priority: major | Milestone: sage-5.12
Component: combinatorics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Volker Braun
Authors: Frédéric Chapoton | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Changes (by {'newvalue': u'Fr\xe9d\xe9ric Chapoton', 'oldvalue': ''}):

* status: needs_review => positive_review
* reviewer: => Volker Braun
* author: => Frédéric Chapoton


Comment:

Looks good to me.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14866#comment:5>

Reply all
Reply to author
Forward
0 new messages