On May 24, 2011, at 7:41 PM, Matthew wrote:

> Cool. I'm going ahead with the changes. I'm currently blocking on the
> reduce_poly_inequalities function.
> It assumes that it's dealing with a list of Intervals which it then
> will return or turn into a relational. I have generalized this
> as_relational process to all sets but am having difficulty when it
> needs to create  sets with inexact arithmetic.
> 
> This python file has a special interval_evalf function used just for
> this one case which makes new intervals with evaluated numbers rather
> than exact ones. i.e.
> Interval(interval.left.evalf(), interval.right.evalf() )
> 
> I don't want to make a union_evalf , finiteset_evalf, etc... but if I
> push this into a ._eval_evalf method then I'll end up overwriting the
> existing Interval._eval_evalf method which seems to be creating
> multiprecision intervals which are used for some other purpose.
> 
> I guess I'm not sure exactly why the inexact bits are needed. When I
> remove this functionality it doesn't seem to break any tests. I'm not
> knowledgeable enough to know if this is important or not.
> 
> Thoughts?
> 
> Also, unrelated question. There are some tests which fail when I run
> bin/test but which pass when I run them from ipython or isympy. I
> suspect this is just something screwy with how I have things set up.
> Sound familiar to anyone?
> 
> -Matt

Is it this issue: http://code.google.com/p/sympy/issues/detail?id=1379 ?

Aaron Meurer

> 
> 
> 
> 
> On May 24, 7:50 pm, Mateusz Paprocki <matt...@gmail.com> wrote:
>> Hi,
>> 
>> On 24 May 2011 17:42, Aaron S. Meurer <asmeu...@gmail.com> wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Hi.
>> 
>>> On May 24, 2011, at 5:50 PM, Matthew Rocklin wrote:
>> 
>>>> Hi Everyone,
>> 
>>>> I'm revamping Sets a bit as a precursor to my GSoC project. The first
>>> part of this is creating a FiniteSet object to go along with Intervals (like
>>> (0, 1] ) and Unions (like [-1,0) U (0, 1] ).
>> 
>>>> I changed the default behavior of Interval(1,1) (interval from 1 to 1
>>> inclusive, i.e. [1, 1] ) to be just the FiniteSet {1} .
>> 
>>>> Unfortunately it appears that Interval(a,a) has been used extensively in
>>> the inequalities module for things like
>> 
>>>> reduce_poly_inequalities([[Eq(x**2, 1)]], x, relational=False) ==
>>> [Interval(-1,-1), Interval(1, 1)]
>> 
>>>> My code changes the result to the FiniteSet {-1, 1} which I think makes
>>> more sense. I'm a little uneasy about going in and changing this much in
>>> modules with which I have little experience. Are people ok with this? Is
>>> there anyone I should converse with while dealing with this particular
>>> problem? (someone involved in inequalities)
>> 
>>>> Best,
>>>> -Matt
>> 
>>> So first off, you should run the tests.  If they still pass, then it means
>>> that the code still works.  This is why we have tests.
>> 
>>> In this particular case, I think it's fine.  That probably would have used
>>> a finite set anyway, if they had existed at the time.  Mateusz wrote this
>>> code, so he could tell you more.  But I personally am +1 to making
>>> Interval(a, a) return FiniteSet(a).
>> 
>> That should work fine, but as Aaron said, change this run tests and see what
>> it the outcome.
>> 
>> 
>> 
>>> Aaron Meurer
>> 
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "sympy" group.
>>> To post to this group, send email to sympy@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> sympy+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/sympy?hl=en.
>> 
>> Mateusz
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to sympy@googlegroups.com.
> To unsubscribe from this group, send email to 
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to