On Jul 2, 2012, at 2:41 PM, "Ondřej Čertík" <[email protected]> wrote:

> On Mon, Jul 2, 2012 at 2:54 AM, Julien Rioux <[email protected]> wrote:
>> Hi all,
>>
>> I notice this failure in master (this is without hash randomization):
>>
>>> ./bin/test --no-subprocess sets
>>>
>>> ===================================== test process starts
>>> ======================================
>>> executable:         /usr/bin/python  (2.7.2-final-0)
>>> architecture:       64-bit
>>> cache:              yes
>>> ground types:       python
>>> random seed:        13242493
>>> hash randomization: off
>>>
>>> sympy/combinatorics/tests/test_subsets.py[1] .
>>> [OK]
>>> sympy/core/tests/test_sets.py[27] ......F....................
>>> [FAIL]
>>> sympy/sets/tests/test_fancysets.py[11] ......Xf...
>>> [OK]
>>>
>>> ________________________________________ xpassed tests
>>> _________________________________________
>>> sympy/sets/tests/test_fancysets.py: test_halfcircle
>>>
>>>
>>> ________________________________________________________________________________________________
>>> _______________________ sympy/core/tests/test_sets.py:test_intersection
>>> ________________________
>>>  File
>>> "/home/jacobi/jrioux/git/sympy-jrioux/sympy/core/tests/test_sets.py", line
>>> 187, in test_intersection
>>>    assert set(i) == set([2, 3])
>>> AssertionError
>>>
>>> tests finished: 36 passed, 1 failed, 1 expected to fail, 1 expected to
>>> fail but passed,
>>> in 0.75 seconds
>>> DO *NOT* COMMIT!
>>
>>
>> It is fixed by this patch:
>>
>>> diff --git a/sympy/core/tests/test_sets.py b/sympy/core/tests/test_sets.py
>>> index adaba2d..4ce6051 100644
>>> --- a/sympy/core/tests/test_sets.py
>>> +++ b/sympy/core/tests/test_sets.py
>>> @@ -184,7 +184,7 @@ def test_intersection():
>>>     # iterable
>>>     i = Intersection(FiniteSet(1,2,3), Interval(2, 5), evaluate=False)
>>>     assert i.is_iterable
>>> -    assert set(i) == set([2, 3])
>>> +    assert set(i) == set([S(2), S(3)])
>>>
>>>     # challenging intervals
>>>     x = Symbol('x', real=True)
>>
>>
>> But I am not sure if this is the proper way to fix it, as one could argue
>> that set(Intersection(...)) should return a set that includes python types
>> instead of sympy types.
>
> You are right --- I was thinking about the same thing when I wrote it.

I think it makes sense to leave them as SymPy types. set() or list()
or whatever should only convert the datatype, not the contents of the
datatype. It's infeasible anyway because they just work by using
__iter__, not to mention inconsistent (set(FiniteSet(Integer(1)))
would give set([int(1)]) but set(FiniteSet(Rational(1, 2))) would give
???).

The real issue here is that set([1, 2]) == set([S(1), S(2)]) gives
False, because of http://code.google.com/p/sympy/issues/detail?id=1973
(ironically enough, I believe the road to fixing that also involves
removing sorting from .args).

Aaron Meurer

>
> But ultimately, it is extremely important that all our tests pass,
> so that other people can continue working. Last
> time for example #1396 (https://github.com/sympy/sympy/pull/1396)
> was bitten by the fact that master fails and so it
> wasn't immediately clear that the tests pass.
>
> So for many sympy contributors, it is of utter importance
> to have stable, reproducible and passing tests in master, so that we
> can immediately see if a PR passes or fails.
>
> Ondrej
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" 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/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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to