Skip to content

Commit

Permalink
Merge pull request #183 from scrasmussen/enhancement/issue182-xarray-…
Browse files Browse the repository at this point in the history
…dims-warning

Issue 182 Fix: Xarray Future Warning
  • Loading branch information
gutmann committed Apr 16, 2024
2 parents 2065ee6 + b46ba42 commit 247cc0d
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 247cc0d

Please sign in to comment.