- various fixes
This commit is contained in:
1 parent
e4de76f26c
commit
a0d2359e55
13 files changed
+191
-97
No files matched your search
+17
-8
@@ -1197,14 +1197,23 @@ impl<D: Dimension, R: Reader> View<D, R> {
|
||||
let _ = out.insert(a);
|
||||
}
|
||||
}
|
||||
let mut n = 1;
|
||||
for (ax, size) in self.shape().to_hashmap().into_iter() {
|
||||
if ((ax == Axis::C) || (ax == Axis::Z) || (ax == Axis::T))
|
||||
&& let Some(Operation::Mean) = self.operations.get(&ax)
|
||||
{
|
||||
n *= size;
|
||||
}
|
||||
}
|
||||
let n = if let Some((&ax, op)) = op_czt.first()
|
||||
&& *op == Operation::Mean
|
||||
{
|
||||
self.axes
|
||||
.iter()
|
||||
.zip(self.slice.iter())
|
||||
.find(|(a, _)| **a == ax)
|
||||
.and_then(|(_, s)| match s {
|
||||
SliceInfoElem::Slice { start, end, step } => {
|
||||
end.map(|e| (((e - start).max(0) / step) as usize).max(1))
|
||||
}
|
||||
_ => Some(1),
|
||||
})
|
||||
.unwrap_or(1)
|
||||
} else {
|
||||
1
|
||||
};
|
||||
let array = if n == 1 {
|
||||
out.take().unwrap()
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user