Skip to content
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 plot bounds for slices in cylindrical coordinates #3820

Merged
merged 3 commits into from
Mar 11, 2022

Conversation

neutrinoceros
Copy link
Member

@neutrinoceros neutrinoceros commented Feb 20, 2022

PR Summary

Reutilizing some bits from #3533, fix #3819
Opening as a draft because there's a secondary problem to solve. Namely, axes ticks are incorrect (0, 0) should always be the origin, not the display center

import numpy as np
import yt
from yt.testing import fake_amr_ds, add_noise_fields

shape = (32, 64, 128)
ds = yt.load_uniform_grid(
    {},
    shape,
    bbox=np.array([[1, 5], [0.1, np.pi / 2 - 0.1], [0, 1]]),
    geometry="polar",
)
add_noise_fields(ds)
p = yt.SlicePlot(ds, "z", "noise1")
p.save("/tmp/")

UniformGridData_Slice_z_noise1

@neutrinoceros
Copy link
Member Author

Solved the secondary issue in a second commit. Now I get:
UniformGridData_Slice_z_noise1

@neutrinoceros
Copy link
Member Author

Also addressed my second comment in the original issue
#3819 (comment)

UniformGridData_Slice_r_noise1
Bonus: also fixed the axis label ('theta' -> 'θ')

@neutrinoceros neutrinoceros added this to the 4.0.3 milestone Feb 20, 2022
@neutrinoceros neutrinoceros marked this pull request as ready for review February 20, 2022 13:32
@neutrinoceros neutrinoceros changed the title BUG: fix plot bounds for z-normal slices in cylindrical coordinates BUG: fix plot bounds for slices in cylindrical coordinates Feb 24, 2022
Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good fix to an annoying problem! Thanks, @neutrinoceros

@neutrinoceros
Copy link
Member Author

@matthewturk any reason not to merge this yet ?

@matthewturk matthewturk merged commit ef08989 into yt-project:main Mar 11, 2022
@lumberbot-app
Copy link

lumberbot-app bot commented Mar 11, 2022

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout yt-4.0.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -m1 ef08989d8222e7172751d17009959102db05dd20
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #3820: BUG: fix plot bounds for slices in cylindrical coordinates'
  1. Push to a named branch:
git push YOURFORK yt-4.0.x:auto-backport-of-pr-3820-on-yt-4.0.x
  1. Create a PR against branch yt-4.0.x, I would have named this PR:

"Backport PR #3820 on branch yt-4.0.x (BUG: fix plot bounds for slices in cylindrical coordinates)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@neutrinoceros neutrinoceros deleted the hotfix_3819 branch March 11, 2022 22:20
neutrinoceros pushed a commit to neutrinoceros/yt that referenced this pull request Mar 11, 2022
BUG: fix plot bounds for slices in cylindrical coordinates
neutrinoceros added a commit that referenced this pull request Mar 30, 2022
Manual backport #3820 to yt-4.0.x (BUG: fix plot bounds for slices in cylindrical coordinates)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: plot bounds are not computed correctly in cylindrical coordinates
2 participants