Adhitya Kamakshidasan | 24 Oct 17:07 2014
Picon

Starting to work on issue

I would like to work upon this issue which has been reported.

https://github.com/sympy/sympy/issues/7570

Would someone please tell me, how to get started with this? 

Where should I start to look for this issue? 

Highly eager to get this going. Sorry, to be asking so trivial questions.

Regards,

Adhitya

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/72b4309a-8feb-4ed0-8700-3f2966878873%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Björn Dahlgren | 24 Oct 16:45 2014
Picon

Refine away Piecewise using assumptions.

Consider the following short example:

http://nbviewer.ipython.org/urls/gist.githubusercontent.com/bjodah/720617780e83d7c35797/raw/c297ecf76a8e26a711b7c7868839f2dfb221bc10/gistfile1.txt

refine with Q.is_true(...) works ok for refining away Piecewise from a solution (although it's a bit picky, e.g. Eq(k**3,0) was needed instead of Eq(k, 0) for example)
It fails to refine to the default though (see last row).

I looked for Q.is_false without luck, I also looked for an Inequality class but found nothing.
I know work on new assumptions is still in the pipeline, my example is with latest sympy in conda (0.7.5), is there away in 0.7.5 or in master to do what I am looking for?

Btw. I have a hackish solution to get out only the defaults of Piecewise here is someone is interested.

Best regards,
/Björn


--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/2fd9a5db-8b47-4779-9be8-c50c02a431dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
redstone-cold | 24 Oct 15:23 2014

LaTeX expresentation as input in SymPy

I have found this function
latex(expr, **settings):
can Convert the given expression to LaTeX representation,but is there any function can take LaTeX expresentation so that it can be used in SymPy ?

i.e. is there any function can take 
\dfrac{2x+2}{2x^3-3x^2+3x+3}
as input in SymPy ?


--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/6eb3ee30.1f4f9.14942533b70.Coremail.redstone-cold%40163.com.
For more options, visit https://groups.google.com/d/optout.
Francesco Bonazzi | 24 Oct 15:16 2014
Picon

Targeting specific subexpression for transformations

Consider this use case

In [97]: expr = 1/(1-x) + 1/(1+x)

In [98]: e2 = Integral(expr, x)

In [99]: e2
Out[99]:
                   
 1       1    
⎜───── + ──────⎟ dx
x + 1   -x + 1  
                   


Suppose now I want to act on the expression inside the integral by applying together and expand on it, is there a simple way to do so?

In [102]: expr.together().expand()
Out[102]:
   
2    
────────
   
2    
- x  + 1


More accurately, is there an easy way to select a subexpression, apply some transformations only on that subexpression, and returning the entire expression with the applied transformations?

In this case one could extract the integral argument by e2.args[0], and then rebuild e2.func(new_arg_0, e2.args[1:]), but imagine if the tree expression is much more complicated and it is hard/uncomfortable to select the subexpression by accessing the args, what can one do?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/b59b0e08-884b-4d09-9065-d604f3509d5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Duane Nykamp | 24 Oct 14:55 2014
Picon
Picon

parse_expr bug with splitting symbols and undefined function

The following throws an error

In [27]: f=Function('f')

In [28]: parse_expr('af(t)', local_dict={'f': f }, transformations=(auto_symbol, auto_number, split_symbols, implicit_multiplication))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

[snip]

TypeError: unbound method as_base_exp() must be called with f instance as first argument (got nothing instead)


The code it is trying to evaluate is

Symbol ('a' )*(f )*(Symbol ('t' ))

It seems the problem is the parentheses around f that were inserted in line 394:
                            result.extend([(OP, '('), (NAME, "%s" % char), (OP, ')'),
                                           (NAME, 'Symbol'), (OP, '(')])

Is there any reason to add those parenthesis?  Certainly, if char is a function, they should not be added.  I'm not sure if there are cases where one does need those parenthesis.

I can fix the problem by changing this line to
                                result.extend([(NAME, "%s" % char),
                                           (NAME, 'Symbol'), (OP, '(')])
but I'm not sure if I should test if local_dict[char] or global_dict[char] is callable (similar to _get_token_callable) and only remove the parenthesis if it is callable.

For this to work, I also have to modify the approach to remove the last 2 tokens (rather than 3) and then skip the following token so that the close parenthesis from the original Symbol is not included.

Does this fix seem reasonable?

Duane

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/5a8ffc92-3be1-4c60-aa0e-0765b20048f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
James Crist | 23 Oct 20:23 2014
Picon

Interest in adding timeout argument to potentially long running calls (potential implementation included)?

For the large expressions that we see in `mechanics`, calls to `simplify` can take an extremely long time. However, for simple expressions, simplification is desirable. Currently we don't simplify by default inside any of our library code, as it's impossible to tell whether the expression can be reasonably simplified or not. If a `timeout` argument was added to such functions though, one could simply run

>>> simplify(expr, timeout=some_reasonable_max_time)

and get the best of both worlds.

However, this isn't the easiest thing to do in Python. The best *composable* option is to use signal.alarm, which is only available on *NIX systems. This can also cause problems with threaded applications. Checks for windows or not running in the main thread could be added to handle this though, but would limit it's use.

---

A second option would be to implement a "pseudo-timeout". This only works for functions that have many calls, but each call is guaranteed to complete in a reasonable amount of time (recursive, simple rules, e.g. `fu`). The timeout won't be exact, but should limit excessively long recursive functions to approximately the timeout. I wrote up a quick implementation of this here. It requires some function boilerplate for each recursive call that *can't* be replaced with a decorator. However, it's only a few lines per function. I think this is the best option if we were to go about adding this.

Thoughts

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/e970f287-3b1d-426a-bbb1-b5f7aeefdf29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Chris Smith | 23 Oct 16:31 2014
Picon

tau of sympy

I thought Aaron had the equivalent of `import this` but can't find it. Can anyone help me with a link?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/9e0e167f-1369-47bd-89e0-6b3a40399ec6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Denis Akhiyarov | 22 Oct 16:22 2014
Picon

sympy@... - 4 updates in 1 topic

I have Note 3, which has 3 programs that recognize stylus-hand-written formulas in real-time:
S Finder + WolframAlpha
S Note
MyScript Calculator (mentioned above)

Also Windows has Math Input Panel which is highly integrated with Word equations.

I tried both FineReader and  InftyReader yesterday and was disappointed.

On Wed, Oct 22, 2014 at 5:53 AM, <sympy <at> googlegroups.com> wrote:
"Ondřej Čertík" <ondrej.certik-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: Oct 21 12:58PM -0600

Hi,
 
This looks really awesome:
 
http://www.engadget.com/2014/10/21/photomath/
 
I wish there was something like that for SymPy, that you snap a
picture and it gives you Python code for SymPy to represent the
equation.
 
Ondrej
Aaron Meurer <asmeurer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: Oct 21 02:44PM -0500

I tried it out. The recognition is actually quite good, at least for
the equations I found in my browser. It says it doesn't work with
handwritten equations, so the typography of the math may be a factor.
 
It's pretty limited on the types of expressions it can recognize, and
even more limited in the kinds of equations it can solve.
 
Another very impressive app in this area is MyScript calculator (there
are iOS and Android versions, both free). You draw the expression with
your finger and it computes it for you. It doesn't do much in the way
of computer algebra, the mathematical handwriting recognition is quite
good.
 
Aaron Meurer
 
Saurabh Jha <saurabh.jhaa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: Oct 22 11:06AM +0530

This looks good. However I am not sure if this would be really useful in
Sympy given the amount of effort it will take to implement this thing.
 
Saurabh
 
Francesco Bonazzi <franz.bonazzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: Oct 22 01:13AM -0700

Apparently there's an open issue to recognize math in tesseract (open
source OCR software)
 
https://code.google.com/p/tesseract-ocr/issues/detail?id=270
 
Unfortunately, tesseract seems to have limited support for layout analysis,
so it's probably not going to recognize fractions/square roots.
 
Anyways, such an idea would require to use external software unrelated to
SymPy (camera handling, OCR, layout analysis and formulae syntax tree
building).
 
An OCR engine that working really well, even with very complicated
formulae, is InftyReader. Unfortunately it's paid software, they sell the
single license for 800 dollars I think (that's crazy!).
 
On Tuesday, October 21, 2014 8:58:47 PM UTC+2, Ondřej Čertík wrote:
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CALxxJLTAiMJVZdSO8JipFJxHG%3DXzh8wADMpN0fYgTc7NC1YEcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Ondřej Čertík | 21 Oct 20:58 2014
Picon

Use camera to read equations

Hi,

This looks really awesome:

http://www.engadget.com/2014/10/21/photomath/

I wish there was something like that for SymPy, that you snap a
picture and it gives you Python code for SymPy to represent the
equation.

Ondrej

--

-- 
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+unsubscribe@...
To post to this group, send email to sympy@...
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CADDwiVAX04_%3DTrmaWnL%2BEOdY3%2BAT0L477P12zXpV_z9bAYnihQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Chong Wang | 20 Oct 11:32 2014
Picon

refine does not work on conjugate

The following code:

from sympy import *
x
= Symbol('x')
refine
(conjugate(x), Q.real(x))


the ourcome is:

conjugate(x)

I wonder why refine does not remove the conjuate head.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/8f7f85c9-bfe4-4b89-a96f-0bead59cc5b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Chong Wang | 20 Oct 11:26 2014
Picon

conjugate cannot be refined

I wonder why the following code will not remove conjugate:

from sympy import *
x
= Symbol('x')
refine
(conjugate(x), Q.real(x))

the outcome is:

conjugate(x)

I wonder why refine does't remove the conjugate function.

BTW, Mathematica also handles conjugate rather poorly. I wonder whether conjugate is hard to deal with.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/abe5dc7b-875e-45f3-868e-dc1bc5619938%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmane