Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions snirf/pysnirf2.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,6 @@ def _read_float_array(dataset: h5py.Dataset) -> np.ndarray:
(27, 1, 'The optional indexed group has no elements'),
# OK (Severity 0)
'OK': (28, 0, 'No issues detected'),
'CONFLICTING_FIELDS_PRESENT': (
29, 3, 'Multiple conflicting fields are present in the same file'
)
}


Expand Down Expand Up @@ -6765,25 +6762,21 @@ def measurementLists_to_measurementList(self):
def _validate(self, result: ValidationResult):

# Override measurementList/measurementLists validation, only one is required
if self.measurementList:
ml = True
else:
ml = False

mls = self.measurementLists.sourceIndex is not None
ml = self.measurementList is not None
mls = self.measurementLists is not None
if (ml and mls):
result._add(self.location + '/measurementList',
'CONFLICTING_FIELDS_PRESENT')
result._add(self.location + '/measurementLists',
'CONFLICTING_FIELDS_PRESENT')
elif (ml or mls):
result._add(self.location + '/measurementList', 'OK')
result._add(self.location + '/measurementLists', 'OK')
elif (ml or mls):
result._add(self.location + '/measurementList',
['OPTIONAL_DATASET_MISSING', 'OK'][int(ml)])
result._add(self.location + '/measurementLists',
['OPTIONAL_DATASET_MISSING', 'OK'][int(mls)])
else:
result._add(self.location + '/measurementList',
'REQUIRED_DATASET_MISSING')
['REQUIRED_DATASET_MISSING', 'OK'][int(ml)])
result._add(self.location + '/measurementLists',
'REQUIRED_DATASET_MISSING')
['REQUIRED_DATASET_MISSING', 'OK'][int(mls)])

# Check time/dataTimeSeries length agreement
if all(attr is not None for attr in [self.time, self.dataTimeSeries]):
Expand Down
3 changes: 0 additions & 3 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,9 +817,6 @@ def test_dynamic(self):

assert sizes[1] < sizes[0], 'Dynamically-loaded files not smaller in memory'

def test_conflicting_fields(self):
# TODO
pass

def setUp(self):
if VERBOSE:
Expand Down