237 def compareDetails(self, other, is2015, debug=False):
238 ''' Returns -9 if none of them is lower than the other (e.g. different met flavour).
239 Returns -1 if identical
240 Returns 0 if other is lower than self.
241 Returns 1 if self is lower than other.
242 '''
243 from copy import deepcopy
244
245 if debug: log.info(f"compareDetails: {len(self.details)} {len(other.details)} {(self.l1seed == other.l1seed)} {(self.details == other.details)}")
246 if len(self.details) != len(other.details):
247 if not is2015 and any([x.startswith("noL1") for x in self.details]):
248 cloneself = deepcopy(self)
249 cloneself.details = [ x for x in self.details if not x.startswith("noL1")]
250 compno = cloneself.compareDetails(other,is2015,debug)
251 if compno ==1 or compno == -1:
252 return 1
253 if not is2015 and any([x.startswith("noL1") for x in other.details]):
254 cloneother = deepcopy(other)
255 cloneother.details = [ x for x in other.details if not x.startswith("noL1")]
256 compno = self.compareDetails(cloneother,is2015,debug)
257 if compno ==0 or compno == -1:
258 return 0
259 if not is2015 and any([x.startswith("nod0") for x in self.details]):
260 cloneself = deepcopy(self)
261 cloneself.details = [ x for x in self.details if not x.startswith("nod0")]
262 compno = cloneself.compareDetails(other,is2015,debug)
263 if compno ==1 or compno == -1:
264 return 1
265 if not is2015 and any([x.startswith("nod0") for x in other.details]):
266 cloneother = deepcopy(other)
267 cloneother.details = [ x for x in other.details if not x.startswith("nod0")]
268 compno = self.compareDetails(cloneother,is2015,debug)
269 if compno ==0 or compno == -1:
270 return 0
271 if any([x.startswith("cut") for x in self.details]):
272 cloneself = deepcopy(self)
273 cloneself.details = [ x for x in self.details if not x.startswith("cut")]
274 compno = cloneself.compareDetails(other,is2015,debug)
275 if compno ==0 or compno == -1:
276 return 0
277 if any([x.startswith("cut") for x in other.details]):
278 cloneother = deepcopy(other)
279 cloneother.details = [ x for x in other.details if not x.startswith("cut")]
280 compno = self.compareDetails(cloneother,is2015,debug)
281 if compno ==1 or compno == -1:
282 return 1
283 return -9
284 compl1seed = self.compareTags(self.l1seed, other.l1seed, stringSubset=True, debug=debug)
285 compdetails = self.compareTags(" ".join(self.details), " ".join(other.details), debug=debug )
286 if self.l1seed == other.l1seed:
287 if self.details == other.details: return -1
288 if debug: log.info(f"compareTags 1: {compdetails}")
289 return compdetails
290
291 if self.details == other.details:
292 if debug: log.info(f"compareTags 2: {compl1seed}")
293 return compl1seed
294
295 if compl1seed == compdetails:
296 return compl1seed
297 return -9
298