Commit 181e0e4d authored by Martin Reinecke's avatar Martin Reinecke
Browse files

try to fix issue #157

parent 0c8a2610
Pipeline #14227 failed with stage
in 4 minutes and 58 seconds
...@@ -1100,7 +1100,7 @@ class Field(Loggable, Versionable, object): ...@@ -1100,7 +1100,7 @@ class Field(Loggable, Versionable, object):
The Lq-norm of the field values. The Lq-norm of the field values.
""" """
return np.sqrt(np.abs(self.dot(x=self))) return np.sqrt(np.abs(self.vdot(x=self)))
def conjugate(self, inplace=False): def conjugate(self, inplace=False):
""" Retruns the complex conjugate of the field. """ Retruns the complex conjugate of the field.
......
...@@ -163,22 +163,18 @@ class RGSpace(Space): ...@@ -163,22 +163,18 @@ class RGSpace(Space):
# flip in the desired directions # flip in the desired directions
for i in axes: for i in axes:
slice_picker = slice_primitive[:] slice_picker = slice_primitive[:]
if shape[i] % 2 == 0:
slice_picker[i] = slice(1, None, None)
else:
slice_picker[i] = slice(None)
slice_picker = tuple(slice_picker)
slice_inverter = slice_primitive[:] slice_inverter = slice_primitive[:]
if shape[i] % 2 == 0: if self.zerocenter[i] == False or shape[i] % 2 == 0:
slice_picker[i] = slice(1, None, None)
slice_inverter[i] = slice(None, 0, -1) slice_inverter[i] = slice(None, 0, -1)
else: else:
slice_picker[i] = slice(None)
slice_inverter[i] = slice(None, None, -1) slice_inverter[i] = slice(None, None, -1)
slice_picker = tuple(slice_picker)
slice_inverter = tuple(slice_inverter) slice_inverter = tuple(slice_inverter)
try: try:
y.set_data(to_key=slice_picker, data=y, y.set_data(to_key=slice_picker, data=y, from_key=slice_inverter)
from_key=slice_inverter)
except(AttributeError): except(AttributeError):
y[slice_picker] = y[slice_inverter] y[slice_picker] = y[slice_inverter]
return y return y
......
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