Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions abapy/postproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@ def norm(self):

:rtype: FieldOutput instance
'''
return (( self * self )**.5).sum()
return (self * self).sum() ** .5

def get_coord(self,number):
'''
Expand Down Expand Up @@ -2225,13 +2225,10 @@ def dot(self, other): # dot (scalar) product
if (type(other) in [int, float, long] or isinstance(other, FieldOutput) or isinstance(other, VectorFieldOutput)) == False:
return NotImplemented
return (self * other).sum()

def __neg__(self):
if (type(other) in [int, float, long] or isinstance(other, FieldOutput) or isinstance(other, VectorFieldOutput)) == False:
return NotImplemented
other = 1.
s1, s2, s3 = self.get_coord(1), self.get_coord(2), self.get_coord(3)
return VectorFieldOutput(data1 = -s1, data2 = -s2, data3 = -s3)
return VectorFieldOutput(data1=-s1, data2=-s2, data3=-s3)

def __sub__(self, other):
if type(other) in [int, float, long] or isinstance(other, FieldOutput) or isinstance(other, VectorFieldOutput) == False:
Expand Down