-
Notifications
You must be signed in to change notification settings - Fork 6
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
Shape error when reading idefix-vtk V2.2.00 #366
Comments
Hi @Anto6453, thanks for your report. I should be able to reproduce this myself, but just in case, could you confirm that you're running the latest version of yt_idefix, and perhaps provide an example setup that you can share ? (Maybe the ini file and definitions.cpp is enough) |
Hi @neutrinoceros, thanks for the answer. |
Thanks ! anything special I need to do to compile your setup ? Doing the naive thing doesn't seem to work (I did check out idefix 2.2.00)
|
In the mean time, I tried an even more naive reproduction using a test setup (HD/KHI) from idefix and didn't see any issue with |
Nevermind, using a setup more similar to yours (spherical + 2D) as a basis, and trying to create a |
Hum, the way |
Ok I'll open one ! Thanks for your help ! |
Last week I updated my idefix repository to version 2.2.00, which adds native coordinates to vtk files. Since then, I've had a problem when I try to load an idefix-vtk file: when yt_idefix wants to calculate the cell_widths, a shape error occurs:
ValueError: could not broadcast input array from shape (N-1,) into shape (N,)
where
N
is the number of cells in the first dimension of my grid, at this lineyt_idefix/src/yt_idefix/data_structures.py
Line 209 in 89d9471
Looking at the code, I noticed that the
read_grid_coordinates()
method, which is supposed to return the coordinates of the cell edges (if I understood correctly), actually returns the coordinates of the cell centers when the native coordinates are in the metadata :yt_idefix/src/yt_idefix/_io/vtk_io.py
Lines 234 to 241 in 89d9471
I tried replacing
XkC_NATIVE_COORDINATES
withXkL_NATIVE_COORDINATES
and this avoided the problem in my case. Does this work, or would another solution be more appropriate?Thanks in advance for the help.
The text was updated successfully, but these errors were encountered: