#7377: Symbolic Ring to Maxima via EclObject
-----------------------------------------------------------------------+----
   Reporter:  nbruin                                                   |       
Owner:  nbruin      
       Type:  enhancement                                              |      
Status:  needs_work  
   Priority:  major                                                    |   
Milestone:  sage-feature
  Component:  symbolics                                                |    
Keywords:              
     Author:  Nils Bruin, Jean-Pierre Flori                            |    
Upstream:  N/A         
   Reviewer:  Jean-Pierre Flori, François Bissey, Karl-Dieter Crisman  |      
Merged:              
Work_issues:                                                           |  
-----------------------------------------------------------------------+----

Comment(by kcrisman):

 Okay, I think I learned enough just barely enough Lisp now that I might be
 able to help on the assumptions/declarations issue.

 However, there are other Maxima errors that might get reported.  So one
 would, at the minimum, want to have a conditional error situation.  One
 princ option wouldn't be enough.  That seems to be a nightmare to do (at
 least for someone not an expert in Lisp).  I even briefly wondered whether
 we might want Sage people at the command line to be able to interact and
 type 'y' like in Maxima, which perhaps is possible now... anyway, that was
 lies madness, at least for me.

 So would it be terribly horrible to catch in the same way the function
 already does?
 {{{
     def sr_integral(self,*args):
         try:
             return
 max_to_sr(maxima_eval(([max_integrate],[sr_to_max(SR(a)) for a in args])))
         except RuntimeError, error:
             s = str(error)
             if "Divergent" in s or "divergent" in s:
                 raise ValueError, "Integral is divergent."
             else:
                 raise error
 }}}
 This is only going to slow things down if there is, in fact, an error.  I
 don't see why one couldn't put something here, if we are already going to
 catch divergent integrals.  And this is basically how it was handled
 before.

 One could similarly do this with `sr_limit` (what is `sr_tlimit`?), with
 examples like
 {{{
 sage: var('a')
 a
 sage: limit(x^a,x=0)
 <snip>
 RuntimeError: ECL says: Maxima asks: Is  a  positive, negative, or zero?
 }}}
 which, remarkably, is not in the doctests (there is no limit question-
 asking error, that is, despite the fact that Maxima certainly will ask
 about this).

 Similarly, with the inconsistent assumptions, one could change the
 try/except
 {{{
       File "/Users/student/Desktop/sage-4.6.2/local/lib/python/site-
 packages/sage/symbolic/assumptions.py", line 104, in assume
         maxima.eval("declare(%s, %s)" % (repr(self._var),
 self._assumption))
       File "/Users/student/Desktop/sage-4.6.2/local/lib/python/site-
 packages/sage/interfaces/maxima_lib.py", line 266, in eval
         if statement: result = ((result + '\n') if result else '') +
 max_to_string(maxima_eval("#$%s$"%statement))
       File "ecl.pyx", line 619, in sage.libs.ecl.EclObject.__call__
 (sage/libs/ecl.c:4425)
       File "ecl.pyx", line 202, in sage.libs.ecl.ecl_safe_apply
 (sage/libs/ecl.c:2609)
     RuntimeError: ECL says: Error executing code in Maxima: declare:
 inconsistent declaration declare(x,odd)
 }}}
 in assumptions.py to look for a RuntimeError.

 The latter is pretty easy to fix, I think.  But hopefully all of these
 could lead to finishing this off.
 [[BR]]

 ----

 What about doctests?  I noticed that definitely not all functions are
 doctested - no surprise, this is a huge project.  Will that hold up
 merging of this, though?

 {{{
 devel/sage/sage/interfaces//maxima_lib.py
 SCORE devel/sage/sage/interfaces//maxima_lib.py: 37% (13 of 35)
 devel/sage/sage/interfaces//maxima_abstract.py
 SCORE devel/sage/sage/interfaces//maxima_abstract.py: 96% (78 of 81)
 devel/sage/sage/interfaces//maxima.py
 SCORE devel/sage/sage/interfaces//maxima.py: 61% (19 of 31)
 }}}

 The current Maxima interface has 94 of 100 functions doctested.  Just
 throwing it out there, I know jpflori also has mentioned it above, but
 this is a little data on it.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7377#comment:107>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to