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). 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.