#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 | 111426739cd1bb4eb395117ff5000d9aafdc23ac
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by dlucas):
Hello,
There's still a few problems:
- You deleted some lines from `spectrum`, especially the ones defining the
local variables (like `F = self.base_ring()`)... Which results in several
failures in this method (l. 3306, for instance, returns `global name F not
known`) because it tries to use variables that are no longer defined.
- (this is quite my fault), the deprecation warning does not work. As you
put
`wtdist_gap = deprecated_function_alias(20565, _spectrum_from_gap)` in
`AbstractLinearCode`, it does not respect the old signature anymore. With
the deprecation mechanism working as expected, one should be able to call
{{{
sage: Gstr = 'Z(2)*[[1,1,1,0,0,0,0], [1,0,0,1,1,0,0], [0,1,0,1,0,1,0],
[1,1,0,1,0,0,1]]'
sage: F = GF(2)
sage: sage.coding.linear_code.wtdist_gap(Gstr, 7, F)
}}}
get a warning and the expected result.
Plus, as I suggested you to remove the input from `_spectrum_from_gap`,
if one calls `C.wtdist_gap(Gstr, 7, F)` because
`C._spectrum_from_gap(Gstr, 7, F)` does not exist...
So, I propose to reinstate `wtdist_gap` where it was and as it was, but
to change its code: now it will send a deprecation warning and call
`_spectrum_from_gap`. It should look like this:
{{{
def wtdist_gap(Gmat, n, F):
from sage.misc.superseded import deprecation
deprecation(20565, "wtdist_gap is now deprecated. Please use
AbstractLinearCode._spectrum_from_gap instead.")
#create a linear code C
return C._spectrum_from_gap()
}}}
It's kind of an idiotic behaviour but it will work.
Best,
David
--
Ticket URL: <http://trac.sagemath.org/ticket/20565#comment:12>
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.