Skip to content

Commit

Permalink
fix: Improve error message clarity in CellMapImage and correct typo i…
Browse files Browse the repository at this point in the history
…n CellMapMultiDataset
  • Loading branch information
rhoadesScholar committed Nov 21, 2024
1 parent 8bb1c6b commit 4a57967
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/cellmap_data/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,8 @@ def class_counts(self) -> float:
self._bg_count = bg_count * np.prod(list(self.scale.values()))
except Exception as e:
# print(f"Error: {e}")
print(
"Unable to get class counts from metadata, falling back to giving foreground 1 pixel, and the rest to background."
)
print(f"Unable to get class counts for {self.path}")
# print("from metadata, falling back to giving foreground 1 pixel, and the rest to background.")
self._class_counts = np.prod(list(self.scale.values()))
self._bg_count = (
np.prod(self.group[self.scale_level].shape) - 1
Expand Down
2 changes: 1 addition & 1 deletion src/cellmap_data/multidataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def validation_indices(self) -> Sequence[int]:
if i == 0:
offset = 0
else:
offset = self.cummulative_sizes[i - 1]
offset = self.cumulative_sizes[i - 1]
sample_indices = np.array(dataset.validation_indices) + offset
indices.extend(list(sample_indices))
except AttributeError:
Expand Down

0 comments on commit 4a57967

Please sign in to comment.