From d4adbf73316d37c6a59ca9d45a45052fb090716f Mon Sep 17 00:00:00 2001 From: Sreekanth kura Date: Thu, 7 Aug 2025 14:13:21 -0400 Subject: [PATCH] Revert "Validation of conflicting measurment lists" --- snirf/pysnirf2.py | 25 +++++++++---------------- tests/test.py | 3 --- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/snirf/pysnirf2.py b/snirf/pysnirf2.py index cfa84f8..aae7a8d 100644 --- a/snirf/pysnirf2.py +++ b/snirf/pysnirf2.py @@ -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' - ) } @@ -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]): diff --git a/tests/test.py b/tests/test.py index b509270..7f3c0e8 100644 --- a/tests/test.py +++ b/tests/test.py @@ -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: