Skip to content

Commit

Permalink
issue 182: fix for future warning about switch from Dataset.dims to D…
Browse files Browse the repository at this point in the history
…ataset.sizes in aggregate_parallel_files.py script
  • Loading branch information
scrasmussen committed Mar 19, 2024
1 parent 2065ee6 commit b46ba42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions helpers/aggregate_parallel_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ def set_up_dataset(d):
x_off, y_off = get_dim_offset(dims)

if len(dims) == 1:
nt = d.dims[dims[0]]
nt = d.sizes[dims[0]]
data = np.zeros((nt))
if len(dims) == 2:
data = np.zeros((ny + y_off, nx + x_off))
if len(dims) == 3:
data = np.zeros((d.dims[dims[0]], ny + y_off, nx + x_off))
data = np.zeros((d.sizes[dims[0]], ny + y_off, nx + x_off))
if len(dims) == 4:
nt = d.dims[dims[0]]
nz = d.dims[dims[1]]
nt = d.sizes[dims[0]]
nz = d.sizes[dims[1]]
data = np.zeros((nt, nz, ny + y_off, nx + x_off))

# print(name, data.shape, dims, attrs)
Expand Down

0 comments on commit b46ba42

Please sign in to comment.