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

Aux items must be unique #318

Merged
merged 3 commits into from
Dec 11, 2023
Merged

Aux items must be unique #318

merged 3 commits into from
Dec 11, 2023

Conversation

ecomodeller
Copy link
Member

Observation and model might have identically named aux_items.

Previously the aux_item from the obs was silently overwritten by aux_item from model.

This PR doesn't allow that.

Copy link
Member

@jsmariegaard jsmariegaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out the suggestion - otherwise great!

set(data.data_vars)
):
raise ValueError(
f"Model and observation have overlapping variables: {overlapping_names}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we be even more helpful here and tell which observation and which model?

(and I guess it could also be a clash between items from two different model results? )

f"Overlapping variables (item names) found when matching observation {observation.name} with Model {mri.name}; overlapping variable names:  {overlapping_names}"

@ecomodeller ecomodeller merged commit 9150fb1 into main Dec 11, 2023
10 checks passed
@ecomodeller ecomodeller deleted the aux-name branch December 11, 2023 12:34
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.

2 participants