#14973: New functions for binary linear codes
---------------------------------+--------------------------
Reporter: veronica | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-5.12
Component: coding theory | Resolution:
Keywords: binary codes | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Dependencies:
Stopgaps: |
---------------------------------+--------------------------
Comment (by burcin):
This is just a list of short comments, nothing like a comprehensive
review. Anybody else looking at this should feel free to test the code and
report problems.
Did you run the tests in this file? I get
{{{
Running doctests with ID 2013-07-26-10-31-10-4d8b78a5.
Doctesting 1 file.
sage -t devel/sage/sage/coding/linear_code.py
**********************************************************************
File "devel/sage/sage/coding/linear_code.py", line 2996, in
sage.coding.linear_code.LinearCode.newton_radius
Failed example:
H =
matrix(GF(2),[[1,0,0,0,1,0,0,0,0,0],[1,0,1,1,0,1,0,0,0,0],[1,1,0,1,0,0,1,0,0,0],
Exception raised:
Traceback (most recent call last):
File "/home/burcin/sage/sage-5.11.beta3/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 485, in _run
compileflags, 1)
File "<doctest
sage.coding.linear_code.LinearCode.newton_radius[0]>", line 1
H =
matrix(GF(Integer(2)),[[Integer(1),Integer(0),Integer(0),Integer(0),Integer(1),Integer(0),Integer(0),Integer(0),Integer(0),Integer(0)],[Integer(1),Integer(0),Integer(1),Integer(1),Integer(0),Integer(1),Integer(0),Integer(0),Integer(0),Integer(0)],[Integer(1),Integer(1),Integer(0),Integer(1),Integer(0),Integer(0),Integer(1),Integer(0),Integer(0),Integer(0)],
^
SyntaxError: unexpected EOF while parsing
**********************************************************************
File "devel/sage/sage/coding/linear_code.py", line 2998, in
sage.coding.linear_code.LinearCode.newton_radius
Failed example:
C = LinearCodeFromCheckMatrix(H)
Exception raised:
Traceback (most recent call last):
File "/home/burcin/sage/sage-5.11.beta3/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 486, in _run
self.execute(example, compiled, test.globs)
File "/home/burcin/sage/sage-5.11.beta3/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 845, in execute
exec compiled in globs
File "<doctest
sage.coding.linear_code.LinearCode.newton_radius[1]>", line 1, in <module>
C = LinearCodeFromCheckMatrix(H)
NameError: name 'H' is not defined
**********************************************************************
File "devel/sage/sage/coding/linear_code.py", line 3000, in
sage.coding.linear_code.LinearCode.newton_radius
Failed example:
C.newton_radius(t)
Exception raised:
Traceback (most recent call last):
File "/home/burcin/sage/sage-5.11.beta3/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 486, in _run
self.execute(example, compiled, test.globs)
File "/home/burcin/sage/sage-5.11.beta3/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 845, in execute
exec compiled in globs
File "<doctest
sage.coding.linear_code.LinearCode.newton_radius[3]>", line 1, in <module>
C.newton_radius(t)
NameError: name 'C' is not defined
**********************************************************************
1 item had failures:
3 of 5 in sage.coding.linear_code.LinearCode.newton_radius
[374 tests, 3 failures, 5.76 s]
----------------------------------------------------------------------
sage -t devel/sage/sage/coding/linear_code.py # 3 doctests failed
----------------------------------------------------------------------
Total time for all tests: 5.9 seconds
cpu time: 4.4 seconds
cumulative wall time: 5.8 seconds
}}}
After fixing that problem, I still have:
{{{
Running doctests with ID 2013-07-26-10-31-50-0e819b57.
Doctesting 1 file.
sage -t devel/sage/sage/coding/linear_code.py
**********************************************************************
File "devel/sage/sage/coding/linear_code.py", line 2999, in
sage.coding.linear_code.LinearCode.newton_radius
Failed example:
C.newton_radius(t)
Exception raised:
Traceback (most recent call last):
File "/home/burcin/sage/sage-5.11.beta3/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 486, in _run
self.execute(example, compiled, test.globs)
File "/home/burcin/sage/sage-5.11.beta3/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 845, in execute
exec compiled in globs
File "<doctest
sage.coding.linear_code.LinearCode.newton_radius[3]>", line 1, in <module>
C.newton_radius(t)
TypeError: newton_radius() takes exactly 1 argument (2 given)
**********************************************************************
1 item had failures:
1 of 5 in sage.coding.linear_code.LinearCode.newton_radius
[374 tests, 1 failure, 4.69 s]
----------------------------------------------------------------------
sage -t devel/sage/sage/coding/linear_code.py # 1 doctest failed
----------------------------------------------------------------------
Total time for all tests: 4.9 seconds
cpu time: 4.3 seconds
cumulative wall time: 4.7 seconds
}}}
Please document and test `__insert_nextnew()` as well. All new functions
introduced in a patch should be tested.
You should rename `covering_rad()` to `covering_radius()`.
The documentation needs a spell check. Did you try building the
documentation? I'm not sure if all of it is formatted properly.
The output of `weight_distribution_coset()` and
`groebner_representation()` should be immutable, i.e., a tuple instead of
a list. It might be better to reconsider the format of
`groebner_representation()` altogether. A list of lists is not very
mathematical. There are quite a few possibilities in Sage to represent
various mathematical structures.
Please run your code through a pep8 checker:
https://pypi.python.org/pypi/pep8
In Python, you don't need to write `CC[len(CC) - 1]` to get the last
element of a list. You can just say `CC[-1]`.
It seems that all your examples/tests use the same code. Can you add
different examples which stress the code properly, covering corner cases,
etc.?
--
Ticket URL: <http://trac.sagemath.org/ticket/14973#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.