Opened 5 years ago

Closed 5 years ago

#15445 closed enhancement (fixed)

A codes.<tab> object for Sage's codes

Reported by: ncohen Owned by:
Priority: major Milestone: sage-6.1
Component: coding theory Keywords:
Cc: dimpase, ppurka, vbraun Merged in:
Authors: Nathann Cohen Reviewers: Punarbasu Purkayastha
Report Upstream: N/A Work issues:
Branch: u/ncohen/15445 (Commits) Commit: 349d7a29b8e1ea8e9aa47447a9ff5c255b2e3484
Dependencies: Stopgaps:

Description

As the title says !

Nathann

Change History (18)

comment:1 Changed 5 years ago by ncohen

  • Branch set to u/ncohen/15445
  • Status changed from new to needs_review

comment:2 Changed 5 years ago by git

  • Commit set to a583c02be72a4ac9e5c998615218efc83deb3c3d

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

a583c02trac #15445: adds a coding.codes_catalog module exported as codes.<tab>
ce3c5d9trac #15445: clean the docstrings of sage.coding.guava

comment:3 Changed 5 years ago by ppurka

Maybe, also remove the other codes from the global namespace? You can try to post it on sage-devel and gather some opinions on whether it is a good idea to remove all the codes from the global namespace. It will probably also improve the startup time of sage by a bit.

comment:4 follow-up: Changed 5 years ago by ncohen

They will tell me to put deprecation warnings everywhere for one year T_T

comment:5 in reply to: ↑ 4 Changed 5 years ago by ppurka

Replying to ncohen:

They will tell me to put deprecation warnings everywhere for one year T_T

Ah yes! That solves it! Put deprecation everywhere. :D On a more serious note, it might be confusing if the codes are available both as, say, HammingCode and codes.HammingCode. So, it is better that something is done about it and a clean interface is provided.

I am actually quite happy to see a codes.<tab>. That keeps it clean and it is easy to remember. Instead of trying to remember all the individual codes, I only need to remember codes and then a tab will show me all the codes that are available in Sage.

comment:6 Changed 5 years ago by ncohen

OKayyyyyyyyy... Ticket updated, deprecation warnings added ! Waiting for a review :-P

Nathann

comment:7 Changed 5 years ago by git

  • Commit changed from a583c02be72a4ac9e5c998615218efc83deb3c3d to fe875f7510dcbde0d7217fc16f360682821013ef

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

fe875f7trac #15445: updates doctests to use codes.<tab>
a1594e9trac #15445: deprecating the Code constructors imported into the global namespace
c84b820trac #15445: add CyclicCode? to codes_catalog

comment:8 Changed 5 years ago by ppurka

This looks good to me. Can you add a doctest or two, against say, HammingCode and ReedSolomonCode just to illustrate that the interface has changed and that the deprecation warning is showed now?

comment:9 Changed 5 years ago by ppurka

By the way, the patchbot has caught some more cases where the old interface is used - all of them are in the documentation.

comment:10 Changed 5 years ago by ncohen

Done !

Nathann

comment:11 Changed 5 years ago by git

  • Commit changed from fe875f7510dcbde0d7217fc16f360682821013ef to 349d7a29b8e1ea8e9aa47447a9ff5c255b2e3484

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

349d7a2Trac #15445: review + broken doctests
75a9443Trac #15445: rebase on 6.1.beta0
3735dfdUpdated Sage version to 6.1.beta0
47c9c75Trac #15224: Iterate over the points of a toric variety
f382aecTrac #15403: knapsack's docstring doesn't document an useful feature
0c95d3dTrac #15228: Default embedding of Ljubljana graph (typo)
09fd00bTrac #12217: Finite field polynomials allow division by zero
9acb905Trac 12217: correctly handle division by zero
8094791Trac #14912: UniqueRepresentation tutorial could use more love
4ce6a49Trac #15442: MILP solver CBC : undefined symbol: dgetrf_

comment:12 Changed 5 years ago by ncohen

Argggg... I just rebased it on 6.1.beta0 and added the patch that you see on top. All others are those that Volker merged into beta0 :-/

Nathann

comment:13 Changed 5 years ago by ppurka

Arrgghh! How do I use the dev scripts to check out your new updates? I had used

sage --dev checkout --ticket 15445

to check out this ticket. Now, how do I get the new updates?

comment:14 Changed 5 years ago by vbraun

$ sage -dev pull -h
usage: sage-dev pull [-h] [--ticket TICKET_OR_REMOTE_BRANCH]

Pull "ticket_or_remote_branch" to "branch".

optional arguments:
  -h, --help            show this help message and exit
  --ticket TICKET_OR_REMOTE_BRANCH, --remote-branch TICKET_OR_REMOTE_BRANCH
                        a string or an integer or "None" (default: "None"), a ticket or a remote branch name; setting this
                        to "None" has the same effect as setting it to the :meth:`current_ticket`.

or just git remote update && git pull trac u/ncohen/15445.

comment:15 Changed 5 years ago by ppurka

Excellent! Thanks!

comment:16 Changed 5 years ago by ppurka

  • Reviewers set to Punarbasu Purkayastha
  • Status changed from needs_review to positive_review

I think this is good to go. I don't see any more problems right now.

I will just check back for the patchbot to catch up with these commits, but I see no failures in doctests in doc/en/thematic_tutorials or doc/en/reference/coding or sage/coding, or sage/matroids.

comment:17 Changed 5 years ago by ncohen

THaaaaaaaaaaaaaaaaaaaaaaaanks !!!

Nathann

comment:18 Changed 5 years ago by vbraun

  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.