Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match() should not fail when a comparison is empty #477

Open
jsmariegaard opened this issue Dec 6, 2024 · 1 comment · May be fixed by #512
Open

match() should not fail when a comparison is empty #477

jsmariegaard opened this issue Dec 6, 2024 · 1 comment · May be fixed by #512
Assignees
Labels
enhancement New feature or request

Comments

@jsmariegaard
Copy link
Member

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)
@jsmariegaard
Copy link
Member Author

Solve by adding action_no_data argument on match() which accepts "ignore", "warn", "error"

@jsmariegaard jsmariegaard added the enhancement New feature or request label Dec 18, 2024
@ecomodeller ecomodeller linked a pull request Mar 11, 2025 that will close this issue
@ecomodeller ecomodeller self-assigned this Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@ecomodeller @jsmariegaard and others