|
179 | 179 | import os |
180 | 180 | import re |
181 | 181 |
|
182 | | -import sage.interfaces.abc |
| 182 | +from pexpect import EOF |
183 | 183 |
|
184 | | -from .expect import Expect, ExpectElement, FunctionElement, ExpectFunction |
| 184 | +import sage.interfaces.abc |
185 | 185 | from sage.env import DOT_SAGE |
186 | | -from pexpect import EOF |
187 | | -from sage.misc.multireplace import multiple_replace |
| 186 | +from sage.interfaces.expect import ( |
| 187 | + Expect, |
| 188 | + ExpectElement, |
| 189 | + ExpectFunction, |
| 190 | + FunctionElement, |
| 191 | +) |
188 | 192 | from sage.interfaces.tab_completion import ExtraTabCompletion |
189 | 193 | from sage.misc.instancedoc import instancedoc |
| 194 | +from sage.misc.multireplace import multiple_replace |
190 | 195 | from sage.structure.richcmp import rich_to_bool |
191 | 196 |
|
192 | | - |
193 | 197 | # The Axiom commands ")what thing det" ")show Matrix" and ")display |
194 | 198 | # op det" commands, gives a list of all identifiers that begin in |
195 | 199 | # a certain way. This could maybe be useful somehow... (?) Also |
196 | 200 | # axiom has a lot a lot of ways for getting documentation from the |
197 | 201 | # system -- this could also be useful. |
198 | 202 |
|
| 203 | + |
199 | 204 | class PanAxiom(ExtraTabCompletion, Expect): |
200 | 205 | """ |
201 | 206 | Interface to a PanAxiom interpreter. |
202 | 207 | """ |
203 | | - def __init__(self, name='axiom', command='axiom -nox -noclef', |
204 | | - script_subdirectory=None, logfile=None, |
205 | | - server=None, server_tmpdir=None, |
206 | | - init_code=[')lisp (si::readline-off)']): |
| 208 | + |
| 209 | + def __init__( |
| 210 | + self, |
| 211 | + name="axiom", |
| 212 | + command="axiom -nox -noclef", |
| 213 | + script_subdirectory=None, |
| 214 | + logfile=None, |
| 215 | + server=None, |
| 216 | + server_tmpdir=None, |
| 217 | + init_code=[")lisp (si::readline-off)"], |
| 218 | + ): |
207 | 219 | """ |
208 | 220 | Create an instance of the Axiom interpreter. |
209 | 221 |
|
210 | 222 | TESTS:: |
211 | 223 |
|
| 224 | + sage: from sage.interfaces.axiom import axiom |
212 | 225 | sage: axiom == loads(dumps(axiom)) |
213 | 226 | True |
214 | 227 | """ |
@@ -829,8 +842,8 @@ def _sage_(self): |
829 | 842 | return self._sage_domain() |
830 | 843 |
|
831 | 844 | if type == "Float": |
832 | | - from sage.rings.real_mpfr import RealField |
833 | 845 | from sage.rings.integer_ring import ZZ |
| 846 | + from sage.rings.real_mpfr import RealField |
834 | 847 | prec = max(self.mantissa().length()._sage_(), 53) |
835 | 848 | R = RealField(prec) |
836 | 849 | x, e, b = self.unparsed_input_form().lstrip('float(').rstrip(')').split(',') |
|
0 commit comments