Skip to content

Commit

Permalink
[RangeDimension] read < 1.2 format alias range ticks
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrewe committed Jun 8, 2021
1 parent c77cbec commit a29fe7c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion nixio/dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,26 @@ def is_alias(self):
elif self.has_link and self.dimension_link._data_object_type == "DataArray":
return True
return False


@property
def _redirgrp(self):
"""
If the dimension is an Alias Range dimension, this property returns
the H5Group of the linked DataArray. Otherwise, it returns the H5Group
representing the dimension.
"""
if self.is_alias:
gname = self._h5group.get_by_pos(0).name
return self._h5group.open_group(gname)
return self._h5group

@property
def ticks(self):
if self.is_alias and not self.has_link:
g = self._redirgrp
if g.has_data("data"):
ticks = g.get_data("data")
return tuple(ticks)
if self.has_link:
ticks = self.dimension_link.values
else:
Expand Down

0 comments on commit a29fe7c

Please sign in to comment.