Skip to content

Commit 7b284e9

Browse files
committed
refactor: replace sample conversion logic with compute_if_dask utility
1 parent f352a71 commit 7b284e9

File tree

1 file changed

+2
-4
lines changed
  • sup3r/preprocessing/samplers

1 file changed

+2
-4
lines changed

sup3r/preprocessing/samplers/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
uniform_box_sampler,
1515
uniform_time_sampler,
1616
)
17-
from sup3r.preprocessing.utilities import lowered
17+
from sup3r.preprocessing.utilities import compute_if_dask, lowered
1818

1919
logger = logging.getLogger(__name__)
2020

@@ -249,9 +249,7 @@ def _compute_samples(self, samples):
249249
"""
250250
if self.mode == 'eager':
251251
return samples
252-
if isinstance(samples, tuple):
253-
return tuple(np.asarray(s) for s in samples)
254-
return np.asarray(samples)
252+
return compute_if_dask(samples)
255253

256254
def _fast_batch(self):
257255
"""Get batch of samples with adjacent time slices."""

0 commit comments

Comments
 (0)