Skip to content

Commit

Permalink
io.agilent: Don't process/store empty nans tiles (tile-by-tile)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuart-cls committed Feb 29, 2024
1 parent 6363932 commit c2ee161
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions orangecontrib/spectroscopy/io/agilent.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ def read_tile(self):
# the not-tiled reader
for y in range(ytiles - 1, -1, -1):
tile = tiles[x, y]()
if np.isnan(tile).all():
# Return an empty Table if tile doesn't exist (instead of storing a tile of nans)
yield Orange.data.Table.from_domain(domain)

Check warning on line 210 in orangecontrib/spectroscopy/io/agilent.py

View check run for this annotation

Codecov / codecov/patch

orangecontrib/spectroscopy/io/agilent.py#L210

Added line #L210 was not covered by tests
x_size, y_size = tile.shape[1], tile.shape[0]
x_locs = np.linspace(x*x_size*px_size, (x+1)*x_size*px_size, num=x_size, endpoint=False)
y_locs = np.linspace((ytiles-y-1)*y_size*px_size, (ytiles-y)*y_size*px_size, num=y_size, endpoint=False)
Expand Down

0 comments on commit c2ee161

Please sign in to comment.