Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinearCode.basis() should be an immutable Sequence #19251

Closed
nathanncohen mannequin opened this issue Sep 20, 2015 · 30 comments
Closed

LinearCode.basis() should be an immutable Sequence #19251

nathanncohen mannequin opened this issue Sep 20, 2015 · 30 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Sep 20, 2015

Right now the .basis() method returns just a list. This should instead be an immutable Sequence, retaining the type information in its .universe() method.

CC: @sagetrac-dlucas

Component: coding theory

Author: Johan Rosenkilde, Nathann Cohen

Branch: b3dc9bf

Reviewer: David Lucas, Daniel Augot

Issue created by migration from https://trac.sagemath.org/ticket/19251

@nathanncohen nathanncohen mannequin added this to the sage-6.9 milestone Sep 20, 2015
@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Sep 20, 2015

Branch: public/19251

@nathanncohen nathanncohen mannequin added the s: needs review label Sep 20, 2015
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 20, 2015

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

f49c204trac #19251: A real matrix as LinearCode.basis()

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 20, 2015

Commit: f49c204

@sagetrac-dlucas
Copy link
Mannequin

sagetrac-dlucas mannequin commented Sep 20, 2015

comment:3

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"?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 20, 2015

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

6cc755dtrac #19251: Better description

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 20, 2015

Changed commit from f49c204 to 6cc755d

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Sep 20, 2015

comment:5

Here it is!

Nathann

@sagetrac-dlucas
Copy link
Mannequin

sagetrac-dlucas mannequin commented Sep 20, 2015

Reviewer: David Lucas

@sagetrac-dlucas
Copy link
Mannequin

sagetrac-dlucas mannequin commented Sep 20, 2015

comment:6

Great!

As all tests pass, I'm giving the green bulb.

David

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Sep 20, 2015

comment:7

Thanks!

@vbraun
Copy link
Member

vbraun commented Sep 20, 2015

comment:8

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]

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Sep 20, 2015

comment:9

Never discuss with a release manager.

Nathann

@nathanncohen nathanncohen mannequin removed this from the sage-6.9 milestone Sep 20, 2015
@johanrosenkilde
Copy link
Contributor

comment:10

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.

@vbraun
Copy link
Member

vbraun commented Sep 25, 2015

comment:11

+1 to returning an immutable Sequence instead of a list... are you going to implement that?

@johanrosenkilde johanrosenkilde added this to the sage-6.9 milestone Sep 25, 2015
@johanrosenkilde johanrosenkilde changed the title A real matrix as LinearCode.basis() LinearCode.basis() should be an immutable Sequence Sep 25, 2015
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 25, 2015

Changed commit from 6cc755d to 91114c5

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 25, 2015

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

7e0416dRevert basis() returning a matrix to returning a list
91114c5LinearCode.basis() returns a Sequence

@kevindilks
Copy link
Mannequin

kevindilks mannequin commented Jan 6, 2016

comment:15

One failing test in documentation due to formatting.

File "src/doc/en/prep/Quickstarts/Graphs-and-Discrete.rst", line 325, in doc.en.prep.Quickstarts.Graphs-and-Discrete
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)
    ]

@kevindilks kevindilks mannequin added s: needs work and removed s: needs review labels Jan 6, 2016
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 15, 2016

Changed commit from 91114c5 to 69fb5c4

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 15, 2016

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

9ccbb3eMerge remote-tracking branch 'trac/develop' into t/19251/public/19251
69fb5c4Fixed doctest in documentation text

@johanrosenkilde
Copy link
Contributor

comment:17

Missed that one - thanks. Rebased and doctest fixed.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 25, 2016

Changed commit from 69fb5c4 to b3dc9bf

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 25, 2016

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

b3dc9bffixed conflict

@sagetrac-danielaugot
Copy link
Mannequin

sagetrac-danielaugot mannequin commented Aug 25, 2016

comment:20

Hi

this is perfectly immutable in my session. Nevertheless, I add to resolve a conflict when pulling.

I set it to positive review

Daniel

@johanrosenkilde
Copy link
Contributor

Changed reviewer from David Lucas to David Lucas, Daniel Augot

@vbraun
Copy link
Member

vbraun commented Aug 27, 2016

Changed branch from public/19251 to b3dc9bf

@jdemeyer
Copy link
Contributor

Changed commit from b3dc9bf to none

@jdemeyer
Copy link
Contributor

Changed author from Johan S. R. Nielsen, Nathann Cohen to Johan Rosenkilde, Nathann Cohen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants