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 dokchister.py #38653

Merged
merged 1 commit into from
Sep 22, 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
10 changes: 3 additions & 7 deletions src/sage/lfunctions/dokchitser.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from sage.structure.sage_object import SageObject
from sage.rings.complex_mpfr import ComplexField
from sage.rings.integer import Integer
from sage.misc.sage_eval import sage_eval
from sage.misc.verbose import verbose
import sage.interfaces.gp
from sage.env import SAGE_EXTCODE
Expand Down Expand Up @@ -478,10 +477,6 @@ def repl(m):
self.__init = (v, cutoff, w, pari_precode, max_imaginary_part,
max_asymp_coeffs)

def __to_CC(self, s):
s = s.replace('.E', '.0E').replace(' ', '')
return self.__CC(sage_eval(s, locals={'I': self.__CC.gen(0)}))

def _clear_value_cache(self):
del self.__values

Expand Down Expand Up @@ -515,6 +510,7 @@ def __call__(self, s, c=None):
except KeyError:
pass
z = self._gp_call_inst('L', s)
CC = self.__CC
if 'pole' in z:
print(z)
raise ArithmeticError
Expand All @@ -525,10 +521,10 @@ def __call__(self, s, c=None):
i = z.rfind('\n')
msg = z[:i].replace('digits', 'decimal digits')
verbose(msg, level=-1)
ans = self.__to_CC(z[i + 1:])
ans = CC(z[i + 1:])
self.__values[s] = ans
return ans
ans = self.__to_CC(z)
ans = CC(z)
self.__values[s] = ans
return ans

Expand Down
Loading