Re: [sympy] Re: Can SymPy's existing set implementation handle parameterized curves?

2019-10-01 Thread Oscar Benjamin
Yeah, a lot of work is needed in sets.

I see that error on master but not on my PR:
https://github.com/sympy/sympy/pull/17593

There it doesn't raise but just returns unevaluated:
In [3]: simplify(a.intersect(b))
Out[3]: {(t, t) | t ∊ [0, 1]} ∩ {(1 - t, t) | t ∊ [0, 1]}

There is no code to handle intersections of this kind of ImageSet yet.

Oscar

On Tue, 1 Oct 2019 at 23:30, EKW  wrote:
>
> OK, I wasn't sure if that was the intended way, since using tuples quickly 
> leads to errors such as:
>
> >>> a = ImageSet(Lambda(t, (t, t)), Interval(0, 1))
> >>> a
> ImageSet(Lambda(t, (t, t)), Interval(0, 1))
> >>> (0,0) in a
> True
> >>> b = ImageSet(Lambda(t, (1 - t, t)), Interval(0, 1))
> >>> b
> ImageSet(Lambda(t, (1 - t, t)), Interval(0, 1))
> >>> a.intersect(b)
> Intersection(ImageSet(Lambda(t, (t, t)), Interval(0, 1)), ImageSet(Lambda(t, 
> (1 - t, t)), Interval(0, 1)))
> >>> simplify(a.intersect(b))
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/home/eward/se/sympy/simplify/simplify.py", line 582, in simplify
> return done(expr)
>   File "/home/eward/se/sympy/simplify/simplify.py", line 541, in done
> rv = e.doit() if doit else e
>   File "/home/eward/se/sympy/core/basic.py", line 1691, in doit
> for term in self.args]
>   File "/home/eward/se/sympy/core/basic.py", line 1691, in 
> for term in self.args]
>   File "/home/eward/se/sympy/sets/fancysets.py", line 460, in doit
> return SetExpr(base_set)._eval_func(f).set
>   File "/home/eward/se/sympy/sets/setexpr.py", line 84, in _eval_func
> res = set_function(func, self.set)
>   File "/home/eward/se/sympy/sets/sets.py", line 2255, in set_function
> return _set_function(f, x)
>   File "/home/eward/se/sympy/multipledispatch/dispatcher.py", line 198, in 
> __call__
> return func(*args, **kwargs)
>   File "/home/eward/se/sympy/sets/handlers/functions.py", line 70, in 
> _set_function
> sing = [i for i in singularities(expr, var)
>   File "/home/eward/se/sympy/calculus/singularities.py", line 83, in 
> singularities
> if not expression.is_rational_function(symbol):
> AttributeError: 'Tuple' object has no attribute 'is_rational_function'
>
> On Tuesday, October 1, 2019 at 2:58:20 PM UTC-7, EKW wrote:
>>
>> For example if I wanted to represent the line segment from (0,0) to (1,1) 
>> (f(t) = (t, t) for t in (0, 1))- can this be done with an image set? How? Or 
>> a curve in 3d space (for example, f(t) = (t^2, t, 1 - t) for t in (0, 1)).
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/9124ca80-5099-4f44-9441-f82af3f9de12%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxShAd6W_Uj_vB%3DSYvDStqtPvQy7Z%2B%2BXstofNsP5P2ssPA%40mail.gmail.com.


[sympy] Re: Can SymPy's existing set implementation handle parameterized curves?

2019-10-01 Thread EKW
OK, I wasn't sure if that was the intended way, since using tuples quickly 
leads to errors such as:

>>> a = ImageSet(Lambda(t, (t, t)), Interval(0, 1))
>>> a
ImageSet(Lambda(t, (t, t)), Interval(0, 1))
>>> (0,0) in a
True
>>> b = ImageSet(Lambda(t, (1 - t, t)), Interval(0, 1))
>>> b
ImageSet(Lambda(t, (1 - t, t)), Interval(0, 1))
>>> a.intersect(b)
Intersection(ImageSet(Lambda(t, (t, t)), Interval(0, 1)), 
ImageSet(Lambda(t, (1 - t, t)), Interval(0, 1)))
>>> simplify(a.intersect(b))
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/eward/se/sympy/simplify/simplify.py", line 582, in simplify
return done(expr)
  File "/home/eward/se/sympy/simplify/simplify.py", line 541, in done
rv = e.doit() if doit else e
  File "/home/eward/se/sympy/core/basic.py", line 1691, in doit
for term in self.args]
  File "/home/eward/se/sympy/core/basic.py", line 1691, in 
for term in self.args]
  File "/home/eward/se/sympy/sets/fancysets.py", line 460, in doit
return SetExpr(base_set)._eval_func(f).set
  File "/home/eward/se/sympy/sets/setexpr.py", line 84, in _eval_func
res = set_function(func, self.set)
  File "/home/eward/se/sympy/sets/sets.py", line 2255, in set_function
return _set_function(f, x)
  File "/home/eward/se/sympy/multipledispatch/dispatcher.py", line 198, in 
__call__
return func(*args, **kwargs)
  File "/home/eward/se/sympy/sets/handlers/functions.py", line 70, in 
_set_function
sing = [i for i in singularities(expr, var)
  File "/home/eward/se/sympy/calculus/singularities.py", line 83, in 
singularities
if not expression.is_rational_function(symbol):
AttributeError: 'Tuple' object has no attribute 'is_rational_function'

On Tuesday, October 1, 2019 at 2:58:20 PM UTC-7, EKW wrote:
>
> For example if I wanted to represent the line segment from (0,0) to (1,1) 
> (f(t) = (t, t) for t in (0, 1))- can this be done with an image set? How? 
> Or a curve in 3d space (for example, f(t) = (t^2, t, 1 - t) for t in (0, 
> 1)).
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/9124ca80-5099-4f44-9441-f82af3f9de12%40googlegroups.com.


Re: [sympy] Can SymPy's existing set implementation handle parameterized curves?

2019-10-01 Thread Oscar Benjamin
Yes, you can do that with ImageSet:

In [11]: ImageSet(Lambda(t, (t, t)), Interval(0, 1))
Out[11]: {(t, t) | t ∊ [0, 1]}

In [14]: ImageSet(Lambda(t, (t**2, t, 1-t)), Interval(0, 1))
Out[14]:
⎧⎛ 2  ⎞ ⎫
⎨⎝t , t, 1 - t⎠ | t ∊ [0, 1]⎬
⎩   ⎭

On Tue, 1 Oct 2019 at 22:58, EKW  wrote:
>
> For example if I wanted to represent the line segment from (0,0) to (1,1) 
> (f(t) = (t, t) for t in (0, 1))- can this be done with an image set? How? Or 
> a curve in 3d space (for example, f(t) = (t^2, t, 1 - t) for t in (0, 1)).
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/8d96f817-802e-412e-948f-a3fc18361419%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxSqefKtjfLa-NpVpSQ4NXvBPCKp81kanUkQSrdwU03Nzg%40mail.gmail.com.


[sympy] Can SymPy's existing set implementation handle parameterized curves?

2019-10-01 Thread EKW
For example if I wanted to represent the line segment from (0,0) to (1,1) 
(f(t) = (t, t) for t in (0, 1))- can this be done with an image set? How? 
Or a curve in 3d space (for example, f(t) = (t^2, t, 1 - t) for t in (0, 
1)).

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/8d96f817-802e-412e-948f-a3fc18361419%40googlegroups.com.


[sympy] Good talk on documentation

2019-10-01 Thread Aaron Meurer
I meant to share this at the beginning of Google Season of Docs but I
couldn't find it until now. This is a talk that was shared by the GSoD
admins at some point.

https://www.youtube.com/watch?v=t4vKPhjcMZg

There's also a blog post version of the talk if you don't have time to
watch it.

https://www.divio.com/blog/documentation/

The talk does a good job of clarifying the different kinds of
documentation how they should be separated. We do a decent but not
perfect job of having this separation in our SymPy docs, and it might
help to make the separation clearer, as suggested at the end of the
talk.

Aaron Meurer

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6JeGMnjf_qjMqp9iOHdoRZ9ir2J9ny8Ve-T%2B8z-ydSuxQ%40mail.gmail.com.