Skip to content

Commit

Permalink
minor logging stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
maurov committed Mar 13, 2024
1 parent a769282 commit c128892
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions larch/io/specfile_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,18 +838,17 @@ def get_scan(self, scan=None, datatype=None):
for label in array_labels[1:]: #: avoid loading twice arr_axis
arr = self.get_array(label).astype(np.float64)
ptsdiff = axis_size - arr.size
#self._logger.debug(f"`{label}` ({arr.size}) -> {abs(ptsdiff)}")
if abs(ptsdiff) > 10:
self._logger.debug(f"`{label}` ({arr.size}) -> {abs(ptsdiff)}")
if abs(ptsdiff) > 10 or ptsdiff < 0:
ipop = array_labels.index(label)
pop_labels.append(array_labels.pop(ipop))
else:
#print(f"{label}: {arr.size} ({ptsdiff})")
ptsdiffs.append(ptsdiff)
data.append(arr)
setattr(out, label, arr)
assert len(array_labels) == len(data) == len(ptsdiffs), "length of array_labels and data do not match"
if len(pop_labels):
self._logger.warning(f"Y arrays >>> not loaded: `{pop_labels}` [excessive size mismatch with `{axis}`]")
self._logger.info(f"Y arrays >>> not loaded: `{pop_labels}` [excessive size mismatch with `{axis}`]")
#: in case of array shape mismatch strip last points
ptsdiff_max = max(ptsdiffs)
if ptsdiff_max > 0:
Expand Down

0 comments on commit c128892

Please sign in to comment.