Skip to content

Commit

Permalink
add Blotch and Fan __eq__
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelaye committed May 31, 2016
1 parent 0c10d22 commit c3eb3e7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions planet4/markings.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ def __init__(self, data, color='b'):
fill=False, linewidth=1, color=color)
self.data = data

def __eq__(self, other):
if self.data.x == other.data.x and\
self.data.y == other.data.y and\
self.data.radius_1 == other.data.radius_1 and\
self.data.radius_2 == other.data.radius_2 and\
self.data.angle == other.data.angle:
return True
else:
return False

@property
def area(self):
return pi * self.data.radius_1 * self.data.radius_2
Expand Down Expand Up @@ -380,6 +390,18 @@ def __init__(self, data, linewidth=0.5, **kwargs):
alpha=0.65, linewidth=linewidth, color='white',
**kwargs)

def __eq__(self, other):
if self.data.x == other.data.x and\
self.data.y == other.data.y and\
self.data.image_x == other.data.image_x and\
self.data.image_y == other.data.image_y and\
self.data.angle == other.data.angle and\
self.data.spread == other.data.spread and\
self.data.distance == other.data.distance:
return True
else:
return False

@property
def n_members(self):
return self._n_members
Expand Down

0 comments on commit c3eb3e7

Please sign in to comment.