Skip to content

Commit

Permalink
remove unnecessary assert and handle boolean labels
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonw committed Dec 10, 2024
1 parent fd5e117 commit bf04fb3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from dacapo.experiments.arraytypes.probabilities import ProbabilityArray
from .predictor import Predictor
from dacapo.experiments import Model
from dacapo.experiments.arraytypes import DistanceArray
from dacapo.tmp import np_to_funlib_array
from dacapo.utils.balance_weights import balance_weights

Expand Down Expand Up @@ -394,6 +393,7 @@ def __find_boundaries(self, labels):
# bound.: 00000001000100000001000 2n - 1

logger.debug(f"computing boundaries for {labels.shape}")
labels = labels.astype(np.uint8)

dims = len(labels.shape)
in_shape = labels.shape
Expand Down
1 change: 0 additions & 1 deletion tests/components/test_gp_arraysource.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ def test_gp_dacapo_array_source(array_config):
batch = source_node.request_batch(request)
data = batch[key].data
if data.dtype == bool:
raise ValueError("Data should not be bools")
data = data.astype(np.uint8)
assert (data - array[array.roi]).sum() == 0

0 comments on commit bf04fb3

Please sign in to comment.