#20565: Fix LinearCode.wtdist_gap method
-------------------------------------+-------------------------------------
Reporter: arpitdm | Owner: arpitdm
Type: defect | Status: needs_work
Priority: minor | Milestone: sage-7.3
Component: coding theory | Resolution:
Keywords: | Merged in:
Authors: Arpit Merchant | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/arpitdm/fix_wtdist_gap_method | 161a2681636d3139a589aafe64f289d982c54bd6
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by dlucas):
* status: needs_review => needs_work
* milestone: sage-7.2 => sage-7.3
Comment:
Hello Arpit,
A few remarks:
- in Sage, you cannot delete/change the signature of a method silently,
you have to support the old method for a year. To do that, you need to use
[http://doc.sagemath.org/html/en/developer/coding_in_python.html#deprecation
deprecation warnings] to notify users about the new functionality (and
warn them the old one will be deleted soon). You can use the following
line:
`wtdist_gap = deprecated_function_alias(20565, _weight_distribution)`.
Then, call the old `wtdist_gap` and you should see a warning.
- I'm not sure the weight distribution should be a private method: it's an
interesting "property" to compute, and I'm sure some users expect to see
it here (maybe Johan can confirm what I'm saying).
In any case, I have a specific method `weight_distribution` in `grs.py`
(as you have a faster algorithm to compute it on MDS codes) and it's not
private. So, for consistency, it should be private everywhere or nowhere
(I vote for nowhere).
- Also, I think we can completely remove the input of this method: as
you're making it a method of `AbstractLinearCode`, it's no longer needed
to pass `n` and `F` (as `self.length()` and `self.base_ring()` will
recover `n` and `F`) and I think having to pass the generator matrix in
it's GAP string format is very annoying...
One should just call `C.weight_distribution()` and get the list.
It's possible to get the GAP format of a matrix by typing `M._gap_()`.
Otherwise, I agree with other changes, the documentation and the new
names.
Best,
David
--
Ticket URL: <http://trac.sagemath.org/ticket/20565#comment:7>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.