Commit a98f7e72 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

tweaks

parent f4a2efa7
......@@ -24,6 +24,9 @@ from ..field import Field
from .linear_operator import LinearOperator
# MR FIXME: this needs a redesign to avoid most _global_data() calls
# Possible approach: keep everything living on `domain` distributed and only
# collect the unstructured Fields.
class MaskOperator(LinearOperator):
def __init__(self, mask):
if not isinstance(mask, Field):
......
......@@ -25,9 +25,8 @@ class SlopeOperator(LinearOperator):
rng = np.arange(target.shape[i])
tmp = np.minimum(
rng, target.shape[i] + 1 - rng) * target.bindistances[i]
fst_dims = (1,) * i
lst_dims = (1,) * (self.ndim - i - 1)
self.pos[i] += tmp.reshape(fst_dims + (shape[i],) + lst_dims)
self.pos[i] += tmp.reshape(
(1,)*i + (shape[i],) + (1,)*(self.ndim-i-1))
@property
def domain(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment