Skip to content

Commit

Permalink
Merge pull request #5052 from chrishavlin/fix_nprocs_cell_width
Browse files Browse the repository at this point in the history
BUG: fix load_uniform_grid with cell_widths and multiple fields
  • Loading branch information
neutrinoceros authored Nov 13, 2024
2 parents 9ba75d1 + 5f7fb9b commit 35be588
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion yt/frontends/stream/tests/test_stream_stretched.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def test_variable_dx():
def data_cell_widths_N16():
np.random.seed(0x4D3D3D3)
N = 16
data = {"density": np.random.random((N, N, N))}
data = {
"density": np.random.random((N, N, N)),
"temperature": np.random.random((N, N, N)),
}

cell_widths = []
for _ in range(3):
Expand Down
2 changes: 1 addition & 1 deletion yt/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ def load_uniform_grid(
bbox,
cell_widths=cell_widths,
)
cell_widths = grid_cell_widths
grid_dimensions = np.array(list(shapes), dtype="int32")
temp[key] = [data[key][slice] for slice in slices]
cell_widths = grid_cell_widths

for gid in range(nprocs):
new_data[gid] = {}
Expand Down

0 comments on commit 35be588

Please sign in to comment.