Skip to content

Commit

Permalink
get rid of sage_eval in grobner_fan
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Jul 19, 2024
1 parent 820502f commit 480e3e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sage/rings/polynomial/groebner_fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@
"""

import string
import re
import pexpect
from subprocess import PIPE, Popen

from sage.misc.sage_eval import sage_eval

from sage.structure.sage_object import SageObject
from sage.interfaces.gfan import gfan
from .multi_polynomial_ideal import is_MPolynomialIdeal
Expand Down Expand Up @@ -983,8 +982,9 @@ def weight_vectors(self):
stdin=PIPE, stdout=PIPE, stderr=PIPE)
ans, err = gfan_processes.communicate(input=str_to_bytes(self.gfan()))
ans = bytes_to_str(ans)
ans = sage_eval(ans.replace('{', '').replace('}', '').replace('\n', ''))
return [vector(QQ, x) for x in ans]
vect = re.compile(r"\([0-9,/\s]*\)")
ans = (tup[1:-1].split(',') for tup in vect.findall(ans))
return [vector(QQ, [QQ(y) for y in x]) for x in ans]

def ring(self):
"""
Expand Down

0 comments on commit 480e3e4

Please sign in to comment.