Skip to content

Commit 097a557

Browse files
committed
added super().__eq__ calls in model files and removed self_link from comparison
1 parent 27d70fb commit 097a557

15 files changed

Lines changed: 15 additions & 63 deletions

frost_sta_client/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = 'frost_sta_client'
2-
__version__ = '1.1.42'
2+
__version__ = '1.1.43'
33
__license__ = 'LGPL3'
44
__author__ = 'Jonathan Vogl'
55
__copyright__ = 'Fraunhofer IOSB'

frost_sta_client/model/actuator.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,8 @@ def ensure_service_on_children(self, service):
135135
self.tasking_capabilities.set_service(service)
136136

137137
def __eq__(self, other):
138-
if other is None:
138+
if not super().__eq__(other):
139139
return False
140-
if not isinstance(other, type(self)):
141-
return False
142-
if id(self) == id(other):
143-
return True
144140
if self.name != other.name:
145141
return False
146142
if self.description != other.description:

frost_sta_client/model/datastream.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,8 @@ def ensure_service_on_children(self, service):
257257
self.observations.set_service(service)
258258

259259
def __eq__(self, other):
260-
if other is None:
260+
if not super().__eq__(other):
261261
return False
262-
if not isinstance(other, type(self)):
263-
return False
264-
if id(self) == id(other):
265-
return True
266262
if self.name != other.name:
267263
return False
268264
if self.description != other.description:

frost_sta_client/model/entity.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ def __eq__(self, other):
111111
return True
112112
if self.id != other.id:
113113
return False
114-
if self.self_link != other.self_link:
115-
return False
116114
return True
117115

118116
def __ne__(self, other):

frost_sta_client/model/ext/unitofmeasurement.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def __eq__(self, other):
7474
return False
7575
if not isinstance(other, type(self)):
7676
return False
77+
if id(self) == id(other):
78+
return True
7779
if self.name != other.name:
7880
return False
7981
if self.definition != other.definition:

frost_sta_client/model/feature_of_interest.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,8 @@ def ensure_service_on_children(self, service):
149149
self.observations.set_service(service)
150150

151151
def __eq__(self, other):
152-
if other is None:
152+
if not super().__eq__(other):
153153
return False
154-
if not isinstance(other, type(self)):
155-
return False
156-
if id(self) == id(other):
157-
return True
158154
if self.name != other.name:
159155
return False
160156
if self.properties != other.properties:

frost_sta_client/model/historical_location.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,8 @@ def ensure_service_on_children(self, service):
9191
self.thing.set_service(service)
9292

9393
def __eq__(self, other):
94-
if other is None:
94+
if not super().__eq__(other):
9595
return False
96-
if not isinstance(other, type(self)):
97-
return False
98-
if id(self) == id(other):
99-
return True
10096
if self.time != other.time:
10197
return False
10298
return True

frost_sta_client/model/location.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,8 @@ def ensure_service_on_children(self, service):
187187
self.historical_locations.set_service(service)
188188

189189
def __eq__(self, other):
190-
if other is None:
190+
if not super().__eq__(other):
191191
return False
192-
if not isinstance(other, type(self)):
193-
return False
194-
if id(self) == id(other):
195-
return True
196192
if self.name != other.name:
197193
return False
198194
if self.description != other.description:

frost_sta_client/model/multi_datastream.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,8 @@ def ensure_service_on_children(self, service):
252252
self.observed_properties.set_service(service)
253253

254254
def __eq__(self, other):
255-
if other is None:
255+
if not super().__eq__(other):
256256
return False
257-
if not isinstance(other, type(self)):
258-
return False
259-
if id(self) == id(other):
260-
return True
261257
if self.name != other.name:
262258
return False
263259
if self.description != other.description:

frost_sta_client/model/observation.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,8 @@ def ensure_service_on_children(self, service):
186186
self.feature_of_interest.set_service(service)
187187

188188
def __eq__(self, other):
189-
if other is None:
189+
if not super().__eq__(other):
190190
return False
191-
if not isinstance(other, type(self)):
192-
return False
193-
if id(self) == id(other):
194-
return True
195191
if self.result != other.result:
196192
return False
197193
if self.phenomenon_time != other.phenomenon_time:

0 commit comments

Comments
 (0)