-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
region_plot does not respect the passed variable order #7809
Comments
comment:1
Attachment: trac-7809-simplify-equify.patch.gz |
comment:2
Looks like this is the only place equify is used, so I think this does not require any deprecation for the removed optional argument. There should be another doctest in to show this works, though, like
Also, the example in the description fails! Though, to be fair, it failed before as well - but I figure I should mention it in case it's related to this ticket after all. Or was the syntax wrong?
|
comment:3
Replying to @kcrisman:
Does this actually produce an incorrect plot before the patch? I'll check, but I'm pretty sure it should work.
This is not related to this ticket. The error is caused by a bug in fast_callable--see #7810. |
comment:4
Replying to @jasongrout:
I didn't bother to check, but it seems like this was the concern, or? At any rate there should be something documented that didn't work before and now does. Otherwise I don't quite get why we are removing the potential for passing in the variables here. |
comment:5
Replying to @kcrisman:
Actually, the second example above produces the wrong image even after the patch is applied! |
comment:6
Are you sure? Are we always putting x on the horizontal axis? This seems okay to me. |
comment:7
no, x shouldn't be on the horizontal axis always. The first variable specified should be on the horizontal axis. That would then be consistent. |
comment:8
Right, and in the second plot the first variable is on the horizontal axis - see attached graphic. By the way, note the one-pixel issue still - aargh! I wonder what the heck is causing that. |
comment:9
Attachment: plot.png Oh, you're right. It is correct. Well, I just rewrote the mangle_neg part anyway. I'll attach a patch in a second. |
comment:10
Before the simplify-negative-code:
After:
|
apply on top of previous patch |
Reviewer: Karl-Dieter Crisman |
Author: Jason Grout |
comment:11
Attachment: trac-7809-simplify-negative-code.patch.gz Too bad about mangle_neg, but it was almost more confusing that way than in the code, I think you are right. Be sure to include some test where the order of coordinates is switched. Incidentally, you should also remove the #long time flag from that one test; it only takes one second on my machine, which I don't think counts as a long time any more. The file takes nearly a half minute to test for me, though! Other than that, positive review. |
comment:12
Replying to @kcrisman:
The old code gave the correct result too, I think. I consider this patch more a refactoring of code. The error that I corrected didn't show up because I think we were more careful in another part of the code. Jason |
Attachment: trac-7809-variable-order.patch.gz apply on top of previous patch |
comment:13
Okay, I made the changes you requested to the doctests and attached a patch. Can you mark this as positively reviewed? |
comment:15
Looks good. The use of s and t is good because then it's not so clear to the user from convention which one "should" be horizontal. Positive review; apply in the order simplify-equify, simplify-negative-code, variable-order. |
comment:16
This ticket also fixes #5885, so that should be closed when this is. (the deprecation warning is now printed). |
Merged: 4.3.1.alpha2 |
Changed merged from 4.3.1.alpha2 to sage-4.3.1.alpha2 |
The call
region_plot(2/x + 1/y > 1/x * 1/y, (x,-10,10), (y,-10,10))
passes the following function to setup_for_eval_on_grid:(y, x) |--> -2/x - 1/y + 1/(x*y)
, but passes the variables in the order (x,y). The problem is the equify function. This patch simplifies the code in equify to not try to put an ordering on the variables, but to just pass back an expression (not a function).In practice, since variables would be substituted by name, I don't think this will make a difference. But it does make the code cleaner and more correct.
Component: graphics
Author: Jason Grout
Reviewer: Karl-Dieter Crisman
Merged: sage-4.3.1.alpha2
Issue created by migration from https://trac.sagemath.org/ticket/7809
The text was updated successfully, but these errors were encountered: