Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get rid of sage_eval in grobner_fan #38392

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading