-
Notifications
You must be signed in to change notification settings - Fork 272
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
BUG: fix incorrect default limits for slice plots along curvilinear directions (phi, theta) #3533
Conversation
7f6326a
to
03f5ba5
Compare
My current solution works for the exact dataset that I wrote the test for, however it is correct in the general case. What's missing is a way to calculate the min and max for elevation (z) and algebraic cylindrical radius (R), composing only with left and right edges of the domain. |
Sigh... this solution isn't general enough either, because it will always set Rmax=rmax |
ebbde67
to
bbc2ec3
Compare
I think I got the the right approach now |
bbc2ec3
to
e0ca3fe
Compare
While I was at it, I also fixed boxing in the "theta"-oriented case import yt
ds = yt.load_sample("bw_spherical_2d", unit_system="code")
p = yt.SlicePlot(ds, "theta", "density")
p.save("/tmp/raw.png") main branch: Now I need to come back one more time to clean up this messy code before I can open this to review. |
e0ca3fe
to
24e43bc
Compare
I'm having a rough time figuring out how to fix the "theta-normal" case. In my previous comment, I noted that axis ticks were x/y inverted, despite the width and centre being correctly computed and the overall result being correct (maybe not the aspect, but well, that would be another sign of a single problem).
|
24e43bc
to
390c562
Compare
I found a pretty ugly hack that fixes the issue: I'm really not found of the current solution as a maintainer, but it seems valuable (maybe not viable) if it works. |
Alright, figured out the last (fatal) issue I had with my Idefix dataset came from some floating point truncation in a case where the domain right edge in the azimuthal direction was supposed to be 2 PI, so I added a small tolerance margin, large enough for single precision |
0662b18
to
8b6edd9
Compare
8b6edd9
to
ea10a37
Compare
So I've simplified this as much as I could but I wasn't able to fix the r-case. Still this PR fixes 2/3 of the problematic cases reported in #3529 so I'm going to open it for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this. Some comments...
# has never worked properly so maybe it's still preferable to | ||
# not having a solution ? | ||
# see https://github.com/yt-project/yt/pull/3533 | ||
bounds = (*bounds[2:4], *bounds[:2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your comment makes me think that we need to have a discussion about moving some of these functions around a bit. It seems that you've likely already come up to speed on what everything does and would be a good person to speculate about potential refactorings that touch the coordinate handlers. Could we set up a time to chat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I went with a very dumb approach of touching everything in a sensible way until something worked. Now I wouldn't say I was able to understand most of it, and I don't think I would be in a position to champion such a refactor, but yes, let's set up a time to discuss that over zoom :)
36bf33d
to
d72b412
Compare
d72b412
to
202c041
Compare
@matthewturk I've backported |
202c041
to
a86e2d9
Compare
@yt-fido test this please |
Just to be clear, my concerns were not articulated as well as I'd like. I am not really concerned about the performance impact as much as just the conceptual nature of it being a singly-calculated item that could be done just once. |
yup, agreed that it didn't make much sense. Now, as a bonus, we'll be able to start using cached_property before we even drop python 3.7, yay. |
@yt-fido test this please |
This looks good to me. Any reason not to merge? |
Thank you for asking. I needed to unlink the linked issue since it always resolves 2/3 cases, but this can go in as is AFAIC, I don't think I'll be able to manage the remaining (theta-phi) soon |
@meeseeksdev backport to yt-4.0.x |
…ice plots along curvilinear directions (phi, theta)
…3-on-yt-4.0.x Backport PR #3533 on branch yt-4.0.x (BUG: fix incorrect default limits for slice plots along curvilinear directions (phi, theta))
PR Summary
addresses #3529 for the phi and theta cases
TODO:
Here's the result from #3529's script with this branch:
![fix_2](https://user-images.githubusercontent.com/14075922/134943949-2f1c14fd-3012-4608-8aaf-435888542915.png)