-
Notifications
You must be signed in to change notification settings - Fork 3
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 reading coordinates in Fargo3DReader.read
#384
Conversation
grid_shape = n3, n1, n2 | ||
shift = n2 // 2 | ||
if geometry_str == "cylindrical": | ||
grid_shape = n3, n1, n2 | ||
tuple_transposition = (1, 2, 0) | ||
shift = n2 // 2 | ||
elif geometry_str == "spherical": | ||
grid_shape = n2, n1, n3 | ||
tuple_transposition = (1, 0, 2) | ||
shift = n3 // 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.
There should be an else: raise NotImplementedError
(even if it's currently unreacheable) to guard against NameError
s
nonos/api/analysis.py
Outdated
else: | ||
return im |
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.
why is this return conditional, and why would it depend on the seemingly unrelated title
argument ?
Also note that returning early in this style makes the filename
argument a no-op, which is probably not desired.
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.
this condition is exactly the same as the one just before for 2D images.
2D case :
im = plot
if title is not None:
colorbar by default
else:
return im # to have more flexibility on what you want in the colorbar, using im
I just reused this already existing structure for the 1D case, because I needed to have more flexibility on it.
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.
then my comment also applies there. I think you are effectively copy-pasting a bug here
52e3c79
to
681dc32
Compare
Fargo3DReader.read
title
argument in plot() function: return artist to be consistent with the 2D case