Opened 9 years ago

Closed 9 years ago

#14866 closed enhancement (fixed)

Lazy imports, NilCoxeterAlgebra, Hall-Littlewood Polynomials

Reported by: Simon King Owned by: Sage Combinat CC user
Priority: major Milestone: sage-5.12
Component: combinatorics Keywords:
Cc: Merged in: sage-5.12.beta1
Authors: Frédéric Chapoton Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


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.

Attachments (1)

trac_14866_first_step.patch (4.5 KB) - added by Frédéric Chapoton 9 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 9 years ago by Frédéric Chapoton

Status: newneeds_review

here is a patch, that hopefully does the job.

comment:2 Changed 9 years ago by Frédéric Chapoton

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

comment:3 Changed 9 years ago by Travis Scrimshaw

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 into the appropriate method (as per the current patch)
  • Remove the global_t in which will remove the creation (from at least) of the poylnomial ring.
  • Have a well-defined set of criterion for when we should lazily import modules.


Changed 9 years ago by Frédéric Chapoton

Attachment: trac_14866_first_step.patch added

comment:4 Changed 9 years ago by Frédéric 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.

comment:5 Changed 9 years ago by Volker Braun

Authors: Frédéric Chapoton
Reviewers: Volker Braun
Status: needs_reviewpositive_review

Looks good to me.

comment:6 Changed 9 years ago by Jeroen Demeyer

Merged in: sage-5.12.beta1
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.