Commit 550a546a authored by Martin Reinecke's avatar Martin Reinecke
Browse files

small tweaks

parent 5e42cb29
Pipeline #20632 passed with stage
in 4 minutes and 16 seconds
......@@ -412,8 +412,8 @@ class Field(object):
if np.isscalar(data):
return data
return_domain = tuple(self.domain[i]
for i in range(len(self.domain))
return_domain = tuple(dom
for i, dom in enumerate(self.domain)
if i not in spaces)
return Field(domain=return_domain, val=data, copy=False)
......@@ -454,7 +454,7 @@ class Field(object):
raise TypeError("argument must be a Field")
if other.domain != self.domain:
raise ValueError("domains are incompatible.")
self.val[()] = other.val
self.val[()] = other.val[()]
# ---General binary methods---
......@@ -144,8 +144,8 @@ class DiagonalOperator(EndomorphicOperator):
for space_index in self._spaces:
active_axes += x.domain.axes[space_index]
reshaper = [x.shape[i] if i in active_axes else 1
for i in range(len(x.shape))]
reshaper = [shp if i in active_axes else 1
for i, shp in enumerate(x.shape)]
reshaped_local_diagonal = np.reshape(self._diagonal.val, reshaper)
# here the actual multiplication takes place
Supports Markdown
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