Re: [sympy] Easy way to use S()

2023-07-13 Thread Jonathan Gutow
On Jul 13, 2023, at 5:23 AM, emanuel.c...@gmail.com wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. Le mercredi 12 juillet 2023 à 22:49:11 UTC+2, gu…@uwosh.edu a

Re: [sympy] Easy way to use S()

2023-07-13 Thread emanuel.c...@gmail.com
Le mercredi 12 juillet 2023 à 22:49:11 UTC+2, gu…@uwosh.edu a écrit : Algebra_with_Sympy release v0.12.0 is now available. It now interprets numbers without decimals as sympy integers. This feature can be turned on and off. Are you trying to

Re: [sympy] Easy way to use S()

2023-07-12 Thread gu...@uwosh.edu
Algebra_with_Sympy release v0.12.0 is now available. It now interprets numbers without decimals as sympy integers. This feature can be turned on and off. On Saturday, July 8, 2023 at 11:39:45 PM UTC-5 gu...@uwosh.edu wrote: > David, > > I hope

Re: [sympy] Easy way to use S()

2023-07-08 Thread gu...@uwosh.edu
David, I hope this message is not a repeat. The one I wrote in reply seems to have been deleted. So briefly: 1. Currently Algebra_with_Sympy does not interpret numbers without decimals as sympy integers, but I have got a working draft that does. I just need to finish updating the tests and

Re: [sympy] Easy way to use S()

2023-07-08 Thread David Bailey
On 07/07/2023 23:23, gu...@uwosh.edu wrote: David, I will work to get this into Algebra_with_Sympy quickly. I will post when I complete the next release. Since these ease of use issues are not cleanly addressable within SymPy proper, maybe you can think of Algebra_with_SymPy as your

Re: [sympy] Easy way to use S()

2023-07-07 Thread gu...@uwosh.edu
David, I will work to get this into Algebra_with_Sympy quickly. I will post when I complete the next release. Since these ease of use issues are not cleanly addressable within SymPy proper, maybe you can think of Algebra_with_SymPy as your interactive front-end for sympy. Jonathan On

Re: [sympy] Easy way to use S()

2023-07-07 Thread David Bailey
On 07/07/2023 10:09, Isuru Fernando wrote: Hi David, You could write a simple converter to convert all ints to sympy Integers if you are writing the code inside a function. See code below. Isuru Thanks, I can solve this problem to my satisfaction, but my main concern, as a pointed out to

Re: [sympy] Easy way to use S()

2023-07-07 Thread Isuru Fernando
Hi David, You could write a simple converter to convert all ints to sympy Integers if you are writing the code inside a function. See code below. Isuru import sympy from sympy.interactive.session import int_to_Integer import inspect import types def use_sympy_ints(f): #

Re: [sympy] Easy way to use S()

2023-07-07 Thread Aaron Meurer
On Thu, Jul 6, 2023 at 4:15 PM David Bailey wrote: > > On 05/07/2023 21:40, Aaron Meurer wrote: > > For interactive use, just passing a string to S() (or equivalently > > sympify() or parse_expr()) is the simplest way to deal with this. > > However, I would avoid this for non-interactive usage

Re: [sympy] Easy way to use S()

2023-07-06 Thread David Bailey
On 05/07/2023 21:40, Aaron Meurer wrote: For interactive use, just passing a string to S() (or equivalently sympify() or parse_expr()) is the simplest way to deal with this. However, I would avoid this for non-interactive usage (i.e., any code that gets saved to be executed later). Putting your

Re: [sympy] Easy way to use S()

2023-07-05 Thread Aaron Meurer
For interactive use, just passing a string to S() (or equivalently sympify() or parse_expr()) is the simplest way to deal with this. However, I would avoid this for non-interactive usage (i.e., any code that gets saved to be executed later). Putting your expression in a string breaks the ability

Re: [sympy] Easy way to use S()

2023-07-03 Thread gu...@uwosh.edu
3e4 in sympy pretty printing is output as a decimal number. At somewhere greater that 10^10 pretty printing switches to scientific notation with a • in sympy. In the code cells I insist on using * for multiplication to avoid any questions about implicit multiplication and multi-character

Re: [sympy] Easy way to use S()

2023-07-03 Thread David Bailey
On 03/07/2023 14:44, gu...@uwosh.edu wrote: David, I want to make sure I understand the behavior you would prefer, because I think I can implement it in algebra-with-sympy . The package already does some pre-parsing, so I

Re: [sympy] Easy way to use S()

2023-07-03 Thread David Bailey
On 03/07/2023 13:24, Oscar Benjamin wrote: Another option is to call S with a string:: In [27]: s = '1 + x*(m + 1/2)/(2*m + 1) + x**2*(m + 1/2)*(m + 3/2)/(2*(2*m + 1)*(2*m + 2))' In [28]: print(S(s)) x**2*(m + 1/2)*(m + 3/2)/((2*m + 2)*(4*m + 2)) + x*(m + 1/2)/(2*m + 1) + 1 -- Oscar Thanks

Re: [sympy] Easy way to use S()

2023-07-03 Thread gu...@uwosh.edu
The documentation for isympy mode is not good. When I search the sympy docs I find this https://docs.sympy.org/latest/modules/interactive.html. I am do not find anything about the -i option on this page. A general web search turns up this old command line doc which also does not document the

Re: [sympy] Easy way to use S()

2023-07-03 Thread gu...@uwosh.edu
David, I want to make sure I understand the behavior you would prefer, because I think I can implement it in algebra-with-sympy . The package already does some pre-parsing, so I think I could handle it there. Here is what I

Re: [sympy] Easy way to use S()

2023-07-03 Thread Oscar Benjamin
On Mon, 3 Jul 2023 at 00:16, David Bailey wrote: > > On 02/07/2023 23:44, Oscar Benjamin wrote: > > On Sun, 2 Jul 2023 at 23:06, David Bailey wrote: > >> Dear Group, > >> > >> If I want to enter m+1/2, I define m as a symbol and write: > >> > >>m+S(1)/2. > >> > >> However if I have a

Re: [sympy] Easy way to use S()

2023-07-02 Thread David Bailey
On 02/07/2023 23:44, Oscar Benjamin wrote: On Sun, 2 Jul 2023 at 23:06, David Bailey wrote: Dear Group, If I want to enter m+1/2, I define m as a symbol and write: m+S(1)/2. However if I have a complicated expression with lots of fractions, such as: 1 + x*(m + 1/2)/(2*m + 1) + x**2*(m +

Re: [sympy] Easy way to use S()

2023-07-02 Thread Oscar Benjamin
On Sun, 2 Jul 2023 at 23:06, David Bailey wrote: > > Dear Group, > > If I want to enter m+1/2, I define m as a symbol and write: > > m+S(1)/2. > > However if I have a complicated expression with lots of fractions, such as: > > 1 + x*(m + 1/2)/(2*m + 1) + x**2*(m + 1/2)*(m + 3/2)/(2*(2*m +

[sympy] Easy way to use S()

2023-07-02 Thread David Bailey
Dear Group, If I want to enter m+1/2, I define m as a symbol and write:  m+S(1)/2. However if I have a complicated expression with lots of fractions, such as: 1 + x*(m + 1/2)/(2*m + 1) + x**2*(m + 1/2)*(m + 3/2)/(2*(2*m + 1)*(2*m + 2)) it would be much neater if I could automatically wrap