Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 10d7ca7

Browse files
committed
reinstated the input, signatures and output of the now-deprecated wtdist_gap method.
1 parent 1114267 commit 10d7ca7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/sage/coding/linear_code.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ def code2leon(C):
292292
f.close()
293293
return file_loc
294294

295+
def wtdist_gap(Gmat, n, F):
296+
from sage.misc.superseded import deprecation
297+
deprecation(20565, "wtdist_gap is now deprecated. Please use AbstractLinearCode._spectrum_from_gap instead.")
298+
G_gap = gap(Gmat)
299+
G = G_gap._matrix_(F)
300+
C = LinearCode(G)
301+
return C._spectrum_from_gap()
302+
295303
def min_wt_vec_gap(Gmat, n, k, F, algorithm=None):
296304
r"""
297305
Returns a minimum weight vector of the code generated by ``Gmat``.
@@ -517,7 +525,7 @@ def bounds_minimum_distance(n, k, F):
517525
lowerBoundExplanation := ...
518526
n := 10,
519527
q := 2,
520-
references := rec(
528+
:3references := rec(
521529
),
522530
upperBound := 4,
523531
upperBoundExplanation := ... )
@@ -3264,8 +3272,6 @@ def _spectrum_from_gap(self):
32643272
v = [eval(gap.eval("w["+str(i)+"]")) for i in range(1,self.length()+2)] # because GAP returns vectors in compressed form
32653273
return v
32663274

3267-
wtdist_gap = deprecated_function_alias(20565, _spectrum_from_gap)
3268-
32693275
def spectrum(self, algorithm=None):
32703276
r"""
32713277
Returns the spectrum of ``self`` as a list.
@@ -3327,6 +3333,9 @@ def spectrum(self, algorithm=None):
33273333
algorithm = "binary"
33283334
else:
33293335
algorithm = "gap"
3336+
F = self.base_ring()
3337+
n = self.length()
3338+
G = self.generator_matrix()
33303339
if algorithm=="gap":
33313340
return self._spectrum_from_gap()
33323341
elif algorithm=="binary":

0 commit comments

Comments
 (0)