Commit c01a3e4a authored by Theo Steininger's avatar Theo Steininger

Removed p from Field.norm

parent d8c9ccc5
Pipeline #12819 passed with stages
in 12 minutes and 22 seconds
...@@ -1054,7 +1054,7 @@ class Field(Loggable, Versionable, object): ...@@ -1054,7 +1054,7 @@ class Field(Loggable, Versionable, object):
dotted = diagonalOperator(x, spaces=spaces) dotted = diagonalOperator(x, spaces=spaces)
return dotted.sum(spaces=spaces) return dotted.sum(spaces=spaces)
def norm(self, q=2): def norm(self):
""" Computes the Lq-norm of the field values. """ Computes the Lq-norm of the field values.
Parameters Parameters
...@@ -1068,11 +1068,7 @@ class Field(Loggable, Versionable, object): ...@@ -1068,11 +1068,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)))
if q == 2:
return (self.dot(x=self)) ** (1 / 2)
else:
return self.dot(x=self ** (q - 1)) ** (1 / q)
def conjugate(self, inplace=False): def conjugate(self, inplace=False):
""" Retruns the complex conjugate of the field. """ Retruns the complex conjugate of the field.
......
...@@ -39,11 +39,12 @@ class SmoothingOperator(EndomorphicOperator): ...@@ -39,11 +39,12 @@ class SmoothingOperator(EndomorphicOperator):
can only live on one space or FieldType can only live on one space or FieldType
sigma : float sigma : float
Sets the length of the Gaussian convolution kernel Sets the length of the Gaussian convolution kernel
log_distances : boolean log_distances : boolean *optional*
States whether the convolution happens on the logarithmic grid or not. States whether the convolution happens on the logarithmic grid or not
(default: False).
default_spaces : tuple of ints *optional* default_spaces : tuple of ints *optional*
Defines on which space(s) of a given field the Operator acts by Defines on which space(s) of a given field the Operator acts by
default (default: None) default (default: None).
Attributes Attributes
---------- ----------
...@@ -117,7 +118,6 @@ class SmoothingOperator(EndomorphicOperator): ...@@ -117,7 +118,6 @@ class SmoothingOperator(EndomorphicOperator):
raise NotImplementedError("For the given Space smoothing " raise NotImplementedError("For the given Space smoothing "
" is not available.") " is not available.")
else: else:
print 'new 4'
return super(SmoothingOperator, cls).__new__(cls, return super(SmoothingOperator, cls).__new__(cls,
domain, domain,
*args, *args,
......
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