#14801: Piecewise functions done right
-------------------------------------+-------------------------------------
       Reporter:  vbraun             |        Owner:  burcin
           Type:  defect             |       Status:  new
       Priority:  major              |    Milestone:  sage-6.2
      Component:  symbolics          |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Volker Braun       |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:  public/piecewise   |       Commit:
   Dependencies:  #14800, #14780,    |  6d00b38418552984fa951bf9c4090da001a1ec9f
  #9556, #13125, #14802              |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by rws):

 It appears that by checking `RealSet.are_pairwise_disjoint(*domain_list)`
 in `piecewise.py:145`, intervals with any boundaries from SR will not be
 accepted anymore.
 {{{
 age: piecewise([((-1, sqrt(2)), -x), ((sqrt(3), 2), x)], var=x)
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)
 <ipython-input-27-571b9720cf91> in <module>()
 ----> 1 piecewise([((-Integer(1), sqrt(Integer(2))), -x),
 ((sqrt(Integer(3)), Integer(2)), x)], var=x)

 /home/ralf/sage/local/lib/python2.7/site-packages/sage/misc/lazy_import.so
 in sage.misc.lazy_import.LazyImport.__call__
 (sage/misc/lazy_import.c:2696)()

 /home/ralf/sage/local/lib/python2.7/site-
 packages/sage/functions/piecewise.pyc in __call__(self, function_pieces,
 **kwds)
     143             domain_list.append(domain)
     144         if not RealSet.are_pairwise_disjoint(*domain_list):
 --> 145             raise ValueError('domains must be pairwise disjoint')
 }}}
 but, since the old class didn't bother, it accepted all input. So the
 doctests in the old class will fail because the old class is redirected to
 the new. Personally I would just remove all doctests from the old class
 instead of fiddling together 200 working ones for a deprecated class. Is
 this allowed?

 In any case I consider the restriction to reals surprising. At least I
 would want to see a better error msg.

--
Ticket URL: <http://trac.sagemath.org/ticket/14801#comment:10>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to