Trideep Biswas closed issue #1: Bug: With multiple change groups, trend_verify method establishes sufficiency with max and min datetimes across change groups...

Trideep Biswas
2023-03-21T01:16:25Z

metars = list(metars)
metars.sort(key=lambda x: x.issuedatetime)

_x = min(__.valid_from for __ in self.change_groups)
_y = max(__.valid_until for __ in self.change_groups)
if any(_cg.illegal_syntax for _cg in self.change_groups):
print("Illegible trend syntax")
return verify_as.ILLEGAL_TREND_SYNTAX

testables = []
for metar in metars:
if metar.issuedatetime == self.issuedatetime:
continue
elif _x <= metar.issuedatetime <= _y:
testables.append(metar)

if any(_ not in map(lambda o: o.issuedatetime, [self.metar_obj] + testables) \
for _ in metar_time_range(\
_x, _y)):
__ = verify_as.NOT_ENOUGH_OBSERVATION_DATA
else:
__ = None

_sufficiency = __ == None

_temp_acc = {k:None for k in Accuracy._fields}
for element in _temp_acc.keys():
_acc = None
for _g in self.change_groups:
if _acc is verify_as.NOT_WITHIN_ACCURACY_LIMITS:
continue
if (_temp := verify_each(element, _g, _sufficiency, *testables)) in \
(_ for _ in verify_as):
if _acc is not None and _temp.value > _acc.value:
_acc = _temp
elif _acc is None:
_acc = _temp
else:
_temp_acc[element] = _acc

Consider the trend issued at 0030: TEMPO TL0100 5000 RA BECMG FM0230 NSW= Whereas the first change group only requires the metars from 0030 until 0100, the second requires from 0230 until 0230. That said, each individual change group does not require min() to max() of metars. In other words, each change has a sufficiency condition independent from other change groups in the same trend.