modelskill
modelskill copied to clipboard
match() should not fail when a comparison is empty
When matching many observations with one or more modelresults with ms.match(obslist, mr), it is annoying when it fails only because a one or a few of comparers have no overlapping data. This forces me to use this ugly block:
cmps = []
for o in obslist:
print(f"Processing {o.name}...")
try:
cmp = ms.match(obs=o, mod=mr)
cmps.append(cmp)
except Exception as e:
print(e)
cc = ms.ComparerCollection(cmps)
instead of just:
cc = ms.match(obs=olist, mod=mr)
Solve by adding action_no_data argument on match() which accepts "ignore", "warn", "error"