Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19315 closed enhancement (fixed)

Clean imports related to coding theory

Reported by: dlucas Owned by:
Priority: major Milestone: sage-6.10
Component: coding theory Keywords:
Cc: ncohen Merged in:
Authors: David Lucas Reviewers: Vincent Delecroix, Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: bc6ecf9 (Commits) Commit:
Dependencies: Stopgaps:

Description

For now, a lot of modules are imported from sage.coding when Sage starts. These modules can be lazy imported instead for better performances.

In all.py there's also several deprecated imports related to a 2-year old ticket. These deprecation warnings can be removed too.

Change History (14)

comment:1 Changed 4 years ago by ncohen

  • Cc ncohen added

comment:2 Changed 4 years ago by dlucas

  • Branch set to u/dlucas/clean_imports

comment:3 Changed 4 years ago by dlucas

  • Authors set to David Lucas
  • Commit set to 8e42c26965ae7548e39561a23f2b45bdfeb77ca8
  • Milestone changed from sage-6.9 to sage-6.10
  • Status changed from new to needs_review

I removed deprecation warnings in all.py, passed everything in lazy imports and fixed a few doctests that broke in the operation.


New commits:

8e42c26Removed deprecation warnings and lazy imported everything

comment:4 Changed 4 years ago by git

  • Commit changed from 8e42c26965ae7548e39561a23f2b45bdfeb77ca8 to dadb126bd845b50e72643d59eb569834b24bf38e

Branch pushed to git repo; I updated commit sha1. New commits:

dadb126Removed lazy import for self_dual_codes_binary

comment:5 Changed 4 years ago by dlucas

As putting self_dual_codes_binary in a lazy import seemed to mess up with the garbage collector doctests in categories/homset.py and structure/coerce.pyx I changed it for a hard import instead.

comment:6 Changed 4 years ago by vdelecroix

  • Reviewers set to Vincent Delecroix
  • Status changed from needs_review to needs_work

Salut David,

  1. The function cyclotomic_cosets was deprecated in #16464 which is also more than one year old. Could you remove the function and the import as well?
  1. Do you really want to keep codesize_upper_bound, dimension_upper_bound, etc in the global namespace?

Vincent

comment:7 Changed 4 years ago by dlucas

Hello Vincent,

The function cyclotomic_cosets was deprecated in #16464 which is also more than one year old. Could >you remove the function and the import as well?

Sure, I'll do that.

Do you really want to keep codesize_upper_bound, dimension_upper_bound, etc in the global namespace?

Not really. I can put them in a catalog so one could access them typing sage.codes.bounds or something like that. It would be better. But if I do that, I guess I need to put a new deprecation warning over these bounds, isn't it?

David

comment:8 Changed 4 years ago by jdemeyer

Can you please also remove the ugly backslashes, they are not needed inside (...) or [...].

comment:9 Changed 4 years ago by git

  • Commit changed from dadb126bd845b50e72643d59eb569834b24bf38e to bc6ecf9dd1596562e824a9fd02840d4ea7ce7874

Branch pushed to git repo; I updated commit sha1. New commits:

9110eafRemoved deprecated cyclotomic_cosets
bc6ecf9New catalog for bounds. Some changes in all.py, fixed doctests.

comment:10 Changed 4 years ago by dlucas

  • Status changed from needs_work to needs_review

I removed cyclotomic_cosetsmethod, add a new catalog for bounds so they won't be available in the global namespace... When the new deprecation warning I added will be deleted in a year. I fixed the doctests that went down in the process.

I also removed the backslashes.

comment:11 Changed 4 years ago by vdelecroix

  • Reviewers changed from Vincent Delecroix to Vincent Delecroix, ​Jeroen Demeyer

I am good with this ticket. Jeroen?

comment:12 Changed 4 years ago by jdemeyer

  • Status changed from needs_review to positive_review

I haven't actually reviewed, I just looked a diff and saw too many backslashes hurting my eyes :-)

comment:13 Changed 4 years ago by vbraun

  • Branch changed from u/dlucas/clean_imports to bc6ecf9dd1596562e824a9fd02840d4ea7ce7874
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:14 Changed 4 years ago by jdemeyer

  • Commit bc6ecf9dd1596562e824a9fd02840d4ea7ce7874 deleted
  • Reviewers changed from Vincent Delecroix, ​Jeroen Demeyer to Vincent Delecroix, Jeroen Demeyer
Note: See TracTickets for help on using tickets.