Skip to content

Commit 526f530

Browse files
committed
[data_view, tag] tiny fixes in class init and exception message
1 parent 2bdfdd3 commit 526f530

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

nixio/data_view.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ class DataView(DataSet):
2121
def __init__(self, da, slices):
2222
self._valid = slices is not None and all(slices)
2323
self._slices = slices
24+
self._error_message = ""
2425
if not self.valid:
2526
self._error_message = (
2627
"InvalidSlice error!"
2728
"Given slice {} is invalid! At least one slice along one dimension"
2829
"does not contain data.".format(slices)
2930
)
30-
else:
31-
self._error_message = ""
3231

3332
if self.valid and len(slices) != len(da.shape):
3433
# This is always checked by the calling function, but we repeat

nixio/tag.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ def _scale_position(pos, unit, dim):
167167
else:
168168
if dimunit is None and unit is not None:
169169
raise IncompatibleDimensions(
170-
"Units of position and SampledDimension "
171-
"must both be given!",
170+
"If a unit if given for the position the dimension must not be without a unit!",
172171
"Tag._pos_to_idx"
173172
)
174173
elif dimunit is not None and unit is not None:

0 commit comments

Comments
 (0)