Skip to content
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

replace .dims with .sizes #212

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_ugrid_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,11 +1133,11 @@ def get_ugrid_fillvaluem999_startindex1_ds():
)

# add dummy face variable in order to have a face dimension in the uds
facevar = np.ones(shape=(ds2.dims[mesh2d_attrs["face_dimension"]]))
facevar = np.ones(shape=(ds2.sizes[mesh2d_attrs["face_dimension"]]))
ds2["mesh2d_facevar"] = xr.DataArray(facevar, dims=(mesh2d_attrs["face_dimension"]))

# add dummy nodevar to plot and trigger triangulation procedure
nodevar = np.ones(shape=(ds2.dims[mesh2d_attrs["node_dimension"]]))
nodevar = np.ones(shape=(ds2.sizes[mesh2d_attrs["node_dimension"]]))
ds2["mesh2d_nodevar"] = xr.DataArray(nodevar, dims=(mesh2d_attrs["node_dimension"]))
return ds2

Expand Down
2 changes: 1 addition & 1 deletion xugrid/ugrid/conventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def _infer_dims(
f" with dimensions: {var_dims}"
)
elif isinstance(key, int):
dim_size = ds.dims[dim]
dim_size = ds.sizes[dim]
if not dim_size == key:
raise UgridDimensionError(
f"Expected size {key} for dimension {dim} in variable "
Expand Down
Loading