Skip to content

Commit

Permalink
Changed var_coords to use list comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelLucaAdams committed Aug 1, 2024
1 parent 321c943 commit 324858d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sdf_xarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ def open_sdf_dataset(filename_or_obj, *, drop_variables=None):
for dim_size, dim_name in zip(value.grid_mid.dims, value.grid_mid.labels):
dim_size_lookup[dim_name][dim_size] = f"{dim_name}_{grid_mid_base_name}"

var_coords = (
var_coords = [
dim_size_lookup[dim_name][dim_size]
for dim_name, dim_size in zip(value.grid.labels, value.dims)
)
]
# TODO: error handling here? other attributes?
data_attrs = {"units": value.units}
data_vars[key] = (var_coords, value.data, data_attrs)
Expand Down

0 comments on commit 324858d

Please sign in to comment.