Skip to content

Commit 3230009

Browse files
committed
try fix benchmarks
1 parent 7f8188a commit 3230009

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dascore/io/febus/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _get_block_time(feb):
5454
# After removing outliers, the mean seems to work better than the median
5555
# for the test files we have. There is still a concerning amount of
5656
# variability.
57-
return np.mean(d_time)
57+
return _maybe_unpack(np.mean(d_time))
5858

5959

6060
@cache

dascore/utils/misc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,8 @@ def maybe_get_items(
463463
def _maybe_unpack(maybe_array):
464464
"""Unpack an array like object if it is size one, else return input."""
465465
size = getattr(maybe_array, "size", 0)
466-
if size == 1:
466+
shape = getattr(maybe_array, "shape", ())
467+
if size == 1 and shape:
467468
maybe_array = maybe_array[0]
468469
return maybe_array
469470

0 commit comments

Comments
 (0)