printing with a >= sign

12 views
Skip to first unread message

Kevin Hunter

unread,
Jan 10, 2012, 2:53:39 PM1/10/12
to sy...@googlegroups.com
Hullo Sympy Group,

Is there a facility to print Greater-Than relations?  All inequality expressions seem to have their lhs and rhs rearranged so that only a <= gets printed, but I'd like to actually print a >= relation.

Thanks,

Kevin

Aaron Meurer

unread,
Jan 10, 2012, 5:29:19 PM1/10/12
to sy...@googlegroups.com
Yeah, as I noted on an issue, this is because internally, Gt(a, b) is
converted into Lt(b, a), which is just called StrictInequality:

In [25]: type(y > x)
Out[25]: sympy.core.relational.StrictInequality

In [26]: type(x < y)
Out[26]: sympy.core.relational.StrictInequality

In [27]: (x < y) == (y > x)
Out[27]: True

So the information is not stored anywhere about how it was made. This
should be fixed.

I created http://code.google.com/p/sympy/issues/detail?id=2979 for this.

Aaron Meurer

> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sympy/-/689G_8rbSzIJ.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.

Kevin Hunter

unread,
Jan 10, 2012, 11:24:28 PM1/10/12
to sy...@googlegroups.com
Thanks for the heads up.  I'll star the issue, as this would be good to be aware of when it's fixed.

Aaron Meurer

unread,
Jan 11, 2012, 7:54:43 AM1/11/12
to sy...@googlegroups.com
Also feel free to give it a shot fixing it. It probably won't be done
any time soon if you don't, unless someone else decides to pick it up.

We can help with any questions you might have. There is a very
complete guide on our development workflow at
https://github.com/sympy/sympy/wiki/development-workflow, which covers
how to use git, how to submit a branch, and things like running tests
and code quality.

Aaron Meurer

On Tue, Jan 10, 2012 at 9:24 PM, Kevin Hunter <hun...@gmail.com> wrote:
> Thanks for the heads up.  I'll star the issue, as this would be good to be
> aware of when it's fixed.
>

> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/sympy/-/xwXw2u8H5b0J.

Kevin Hunter

unread,
Jan 11, 2012, 10:04:00 AM1/11/12
to sy...@googlegroups.com
Heh, I appreciate your apparent faith in my coding skill.  I'll take the suggestion under advisement, but I'm more of an optimization feller than I am an algebraic wiz.  There would be a lot of learning I'd have to do of the Sympy internals ...

Aaron Meurer

unread,
Jan 11, 2012, 1:05:50 PM1/11/12
to sy...@googlegroups.com
I don't think there's much that's heavily algorithmic involved. It just involves restructuring the classes in one of the two ways I suggested in the issue. 

I think most of our contributions come from people who have not studied complex computer algebra algorithms. They, like you, are users of SymPy who  wanted some feature or found some bug. The majority of things do not require much more knowledge than Python programming and the math behind whatever you are working with. 

For this, the math is trivial, and your code from issue 2960 is enough to convince me that you know enough Python. 

And if you have questions with the SymPy internals, we will happily answer them. 

Aaron Meurer

On Jan 11, 2012, at 8:04 AM, Kevin Hunter <hun...@gmail.com> wrote:

Heh, I appreciate your apparent faith in my coding skill.  I'll take the suggestion under advisement, but I'm more of an optimization feller than I am an algebraic wiz.  There would be a lot of learning I'd have to do of the Sympy internals ...

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/7URonPtQuAQJ.
Reply all
Reply to author
Forward
0 new messages