Skip to content

Commit 4244488

Browse files
authored
Handle tuple unit on xarray attribute (#4881)
1 parent 9456b97 commit 4244488

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

holoviews/core/data/xarray.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def retrieve_unit_and_label(dim):
8383
dim = asdim(dim)
8484
coord = data[dim.name]
8585
unit = coord.attrs.get('units') if dim.unit is None else dim.unit
86+
if isinstance(unit, tuple):
87+
unit = unit[0]
8688
if 'long_name' in coord.attrs:
8789
spec = (dim.name, coord.attrs['long_name'])
8890
else:

0 commit comments

Comments
 (0)