#19251 closed enhancement (fixed)
LinearCode.basis() should be an immutable Sequence
Reported by:  Nathann Cohen  Owned by:  

Priority:  major  Milestone:  sage6.9 
Component:  coding theory  Keywords:  beginner 
Cc:  David Lucas  Merged in:  
Authors:  Johan Rosenkilde, Nathann Cohen  Reviewers:  David Lucas, Daniel Augot 
Report Upstream:  N/A  Work issues:  
Branch:  b3dc9bf (Commits, GitHub, GitLab)  Commit:  
Dependencies:  Stopgaps: 
Description (last modified by )
Right now the .basis()
method returns just a list
. This should instead be an immutable Sequence
, retaining the type information in its .universe()
method.
Change History (24)
comment:1 Changed 7 years ago by
Branch:  → public/19251 

Status:  new → needs_review 
comment:2 Changed 7 years ago by
Commit:  → f49c2040646aae994149a5a88a6ae4eb1d7a2941 

comment:3 Changed 7 years ago by
Status:  needs_review → needs_info 

Hello,
Just a question: if you're not adding a deprecation warning to this (which I agree with), what do you think about adding extra info to the docstring, like
"Returns a basis of self
as a matrix of the ambient space of self
"?
comment:4 Changed 7 years ago by
Commit:  f49c2040646aae994149a5a88a6ae4eb1d7a2941 → 6cc755d0834799c340f881873acb9f6a57460a07 

Branch pushed to git repo; I updated commit sha1. New commits:
6cc755d  trac #19251: Better description

comment:6 Changed 7 years ago by
Reviewers:  → David Lucas 

Status:  needs_review → positive_review 
Great!
As all tests pass, I'm giving the green bulb.
David
comment:8 Changed 7 years ago by
Status:  positive_review → needs_work 

Doctests fail.
Also, a matrix is not a basis. Matrices have row and column spans, its not clear which one you mean if you just return a matrix. This is how it is supposed to work:
sage: (QQ^3).span([(1,2,3)]).basis() [ (1, 2, 3) ] sage: _.universe() Vector space of degree 3 and dimension 1 over Rational Field Basis matrix: [1 2 3]
comment:9 Changed 7 years ago by
Milestone:  sage6.9 → sageduplicate/invalid/wontfix 

Status:  needs_work → positive_review 
Never discuss with a release manager.
Nathann
comment:10 Changed 7 years ago by
There's still something of a bug, though, since the type returned by LinearCode.basis()
is list
, while what Volker writes about is a Sequence_generic
, which exactly supports the universe
method.
comment:11 Changed 7 years ago by
Status:  positive_review → needs_info 

+1 to returning an immutable Sequence instead of a list... are you going to implement that?
comment:12 Changed 7 years ago by
Authors:  Nathann Cohen → Johan S. R. Nielsen, Nathann Cohen 

Cc:  Johan Rosenkilde removed 
Description:  modified (diff) 
Milestone:  sageduplicate/invalid/wontfix → sage6.9 
Status:  needs_info → needs_work 
Summary:  A real matrix as LinearCode.basis() → LinearCode.basis() should be an immutable Sequence 
Ok, I'm on it...
comment:13 Changed 7 years ago by
Commit:  6cc755d0834799c340f881873acb9f6a57460a07 → 91114c53c06cb430e3738a187a7fadafa7742879 

comment:14 Changed 7 years ago by
Status:  needs_work → needs_review 

comment:15 Changed 7 years ago by
Status:  needs_review → needs_work 

One failing test in documentation due to formatting.
File "src/doc/en/prep/Quickstarts/GraphsandDiscrete.rst", line 325, in doc.en.prep.Quickstarts.GraphsandDiscrete Failed example: D.basis() Expected: [(1, 0, 1, 0, 1, 0, 1), (0, 1, 1, 0, 0, 1, 1), (0, 0, 0, 1, 1, 1, 1)] Got: [ (1, 0, 1, 0, 1, 0, 1), (0, 1, 1, 0, 0, 1, 1), (0, 0, 0, 1, 1, 1, 1) ]
comment:16 Changed 7 years ago by
Commit:  91114c53c06cb430e3738a187a7fadafa7742879 → 69fb5c42f93e423a1a4a5be19a54cfdb2b20972d 

comment:17 Changed 7 years ago by
Status:  needs_work → needs_review 

Missed that one  thanks. Rebased and doctest fixed.
comment:18 Changed 6 years ago by
Keywords:  beginner added 

comment:19 Changed 6 years ago by
Commit:  69fb5c42f93e423a1a4a5be19a54cfdb2b20972d → b3dc9bfa5bb473c52d54dd507d39c512216c16bc 

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

comment:20 Changed 6 years ago by
Hi
this is perfectly immutable to me. Nevertheless, I add to resolve a conflict when pulling.
Daniel
comment:21 Changed 6 years ago by
Status:  needs_review → positive_review 

comment:22 Changed 6 years ago by
Reviewers:  David Lucas → David Lucas, Daniel Augot 

comment:23 Changed 6 years ago by
Branch:  public/19251 → b3dc9bfa5bb473c52d54dd507d39c512216c16bc 

Resolution:  → fixed 
Status:  positive_review → closed 
comment:24 Changed 5 years ago by
Authors:  Johan S. R. Nielsen, Nathann Cohen → Johan Rosenkilde, Nathann Cohen 

Commit:  b3dc9bfa5bb473c52d54dd507d39c512216c16bc 
Branch pushed to git repo; I updated commit sha1. New commits:
trac #19251: A real matrix as LinearCode.basis()