The SNIRF specification states that the probe/sourceLabels dataset can "be of size <number of sources>x 1 or <number of sources> x <number of wavelengths>". However, when using pysnirf2 to validate a SNIRF file in which the probe/sourceLabels dataset is two-dimensional, I get an INVALID_DATASET_SHAPE.
I assume this results from the following section of code:
name = self.location + '/sourceLabels'
if type(self._sourceLabels) in [type(_AbsentDataset), type(None)]:
result._add(name, 'OPTIONAL_DATASET_MISSING')
else:
try:
if type(self._sourceLabels) is type(_PresentDataset) or 'sourceLabels' in self._h:
dataset = self._h['sourceLabels']
else:
dataset = _create_dataset_string_array(tmp, 'sourceLabels', self._sourceLabels)
result._add(name, _validate_string_array(dataset, ndims=[1]))
Is this an oversight or have I misunderstood the intent of the specification?
Yes, this is a mistaken constraint on the dimensionality of sourceLabels and detectorLabels. Thank you! I will advance a fix to the generation code, this likely affects other arrays in the spec
The SNIRF specification states that the
probe/sourceLabels
dataset can "be of size<number of sources>x 1
or<number of sources> x <number of wavelengths>
". However, when usingpysnirf2
to validate a SNIRF file in which theprobe/sourceLabels
dataset is two-dimensional, I get anINVALID_DATASET_SHAPE
.I assume this results from the following section of code:
Is this an oversight or have I misunderstood the intent of the specification?