Skip to content

Commit 651235a

Browse files
Refactor dimension extraction for HDF5 files
Refactor HDF5 dimension handling to use a list for labels.
1 parent af727f8 commit 651235a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

ncompare/Comparison.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,14 @@ def _create_var_properties(
426426
if self.file_types == "netcdf":
427427
v_dimensions = str(the_variable.dimensions)
428428
elif self.file_types == "hdf5":
429-
print(str(the_variable))
429+
dim_list: list[str] = []
430430
for dim in the_variable.dims:
431-
print(str(dim))
432-
v_dimensions = str([dim.label for dim in the_variable.dims])
431+
try:
432+
dim_list.append(dim.label)
433+
except RuntimeError as err:
434+
dim_list.append("none")
435+
436+
v_dimensions = str(dim_list)
433437

434438
v_shape = str(the_variable.shape).strip()
435439

0 commit comments

Comments
 (0)