Skip to content

Commit

Permalink
Make sure fields are read in the order they appear in the file
Browse files Browse the repository at this point in the history
  • Loading branch information
Corentin Cadiou committed May 17, 2024
1 parent 2880d15 commit 48b5c95
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions yt/frontends/ramses/io_utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ def fill_hydro(FortranFile f,
cdef int jump_len, Ncells
cdef np.uint8_t[::1] mask_level = np.zeros(nlevels, dtype=np.uint8)

# First, make sure fields are in the same order
fields = sorted(fields, key=lambda f: all_fields.index(f))

# The ordering is very important here, as we'll write directly into the memory
# address the content of the files.
cdef np.float64_t[::1, :, :] buffer
Expand Down

0 comments on commit 48b5c95

Please sign in to comment.