Skip to content

Flexible error handling of empty comparers #512

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

ecomodeller
Copy link
Member

@ecomodeller ecomodeller commented Mar 11, 2025

This PR introduces flexible error handling for cases where observations and model results do not overlap. It adds a new parameter, obs_no_overlap, to the match function and related methods, allowing users to specify whether to ignore, raise an error, or issue a warning when no overlap is found.

This makes it easier for the end-user but the current implementation adds complexity by returning None from several methods. A more elegant solution would be to use the Null object pattern.

@ecomodeller ecomodeller linked an issue Mar 11, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

match() should not fail when a comparison is empty
1 participant