File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -463,7 +463,8 @@ def maybe_get_items(
463463def _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
You can’t perform that action at this time.
0 commit comments