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

Commit

Permalink
further improve translation to sage objects, make restart work, fix d…
Browse files Browse the repository at this point in the history
…octests
  • Loading branch information
mantepse committed Aug 16, 2016
1 parent 5b4a95d commit 0ab0f92
Show file tree
Hide file tree
Showing 7 changed files with 361 additions and 219 deletions.
53 changes: 0 additions & 53 deletions src/sage/interfaces/axiom.py
Expand Up @@ -383,10 +383,6 @@ def set(self, var, value):
sage: axiom.get('xx') #optional - axiom
'2'
sage: fricas.set('xx', '2') #optional - fricas
sage: fricas.get('xx') #optional - fricas
'2'
"""
cmd = '%s := %s'%(var, value)
out = self._eval_line(cmd, reformat=False)
Expand Down Expand Up @@ -423,20 +419,6 @@ def _eval_line(self, line, reformat=True, allow_use_file=False,
sage: print(axiom._eval_line('2+2')) # optional - axiom
4
Type: PositiveInteger
sage: fricas._eval_line(")set output algebra off") #optional - fricas
''
sage: fricas._eval_line(")set output tex on") #optional - fricas
''
sage: print(fricas._eval_line("2+2")) # optional - fricas
$$
4
\leqno(11)
$$
Type: PositiveInteger
sage: fricas._eval_line(")set output tex off") #optional - fricas
''
sage: fricas._eval_line(")set output algebra on") #optional - fricas
''
"""
if not wait_for_prompt:
return Expect._eval_line(self, line)
Expand Down Expand Up @@ -499,8 +481,6 @@ def _equality_symbol(self):
sage: a = axiom(x==6); a #optional axiom
x= 6
sage: a = fricas(x==6); a #optional fricas
x= 6
"""
return "="

Expand Down Expand Up @@ -709,14 +689,6 @@ def comma(self, *args):
sage: _.type() #optional - axiom
Tuple PositiveInteger
sage: two = fricas(2) #optional - fricas
sage: two.comma(3) #optional - fricas
[2,3]
sage: two.comma(3,4) #optional - fricas
[2,3,4]
sage: _.type() #optional - fricas
Tuple(PositiveInteger)
"""
P = self._check_valid()
args = list(args)
Expand All @@ -734,9 +706,6 @@ def _latex_(self):
sage: latex(a) #optional - axiom
\frac{1}{2}
sage: a = fricas(1/2) #optional - fricas
sage: latex(a) #optional - fricas
1 \over 2
"""
self._check_valid()
P = self.parent()
Expand Down Expand Up @@ -767,15 +736,6 @@ def as_type(self, type):
sage: _.type() #optional - axiom
DoubleFloat
::
sage: a = fricas(1.2); a #optional - fricas
1.2
sage: a.as_type(fricas.DoubleFloat) #optional - fricas
1.2
sage: _.type() #optional - fricas
DoubleFloat
"""
P = self._check_valid()
type = P(type)
Expand All @@ -794,9 +754,6 @@ def unparsed_input_form(self):
sage: a.unparsed_input_form() #optional - axiom
'x*x+1'
sage: a = fricas(x^2+1) #optional - fricas
sage: a.unparsed_input_form() #optional - fricas
'x^2+1'
"""
P = self._check_valid()
s = P.eval('unparse(%s::InputForm)'%self._name)
Expand Down Expand Up @@ -832,9 +789,6 @@ def _sage_(self):
sage: gp(axiom(1/2)) #optional - axiom
1/2
sage: fricas(1/2).sage() #optional - fricas
1/2
DoubleFloat's in Axiom are converted to be in RDF in Sage.
::
Expand Down Expand Up @@ -920,19 +874,12 @@ def _sage_domain(self):
sage: axiom('Integer').sage() #optional - axiom
Integer Ring
sage: fricas('Integer').sage() #optional - fricas
Integer Ring
sage: axiom('Fraction Integer').sage() #optional - axiom
Rational Field
sage: fricas('Fraction Integer').sage() #optional - fricas
Rational Field
sage: axiom('DoubleFloat').sage() #optional - axiom
Real Double Field
sage: fricas('DoubleFloat').sage() #optional - fricas
Real Double Field
"""
P = self._check_valid()
name = str(self)
Expand Down

0 comments on commit 0ab0f92

Please sign in to comment.