-
Notifications
You must be signed in to change notification settings - Fork 129
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
support for multiple model occurrence in perf main #1649
Conversation
Is this ready for testing? |
Was wanting to wait for @zklaus feedback to see if it fixes his problem before marking ready. Ready from my side though. |
Just gonna mark this as ready since there's been no word from @zklaus and I guess other people can test it just as well knowing what the issue was. |
@mattiarighi or @zklaus It would be great if you could have a go at reviewing/testing this before the ESMValTool v2.0.0 feature freeze next week? |
Will test once @zklaus has approved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is small bug in this snippet, which will repeatedly include the experiment/ensemble to the datasetnames.
I propose some changes to immediately exit from the loop once the experiment/ensemble names are appended.
; Extend model name by ensemble/experiment on multiple occurence
if (.not. (dimsizes(datasetnames) .eq. \
count_unique_values(datasetnames))) then
new_datasetnames = datasetnames
experiments = metadata_att_as_array(info_items, "exp")
ensembles = metadata_att_as_array(info_items, "ensemble")
do imod = 0, dimsizes(datasetnames) - 1
do jmod = 0, dimsizes(datasetnames) - 1
if imod.eq.jmod then
continue
else
if (datasetnames(imod) .eq. datasetnames(jmod)) then
if (experiments(imod) .ne. experiments(jmod)) then
new_datasetnames(imod) = new_datasetnames(imod) + " " + \
experiments(imod)
break
end if
end if
end if
end do
end do
do imod = 0, dimsizes(datasetnames) - 1
do jmod = 0, dimsizes(datasetnames) - 1
if imod.eq.jmod then
continue
else
if (datasetnames(imod) .eq. datasetnames(jmod)) then
if (ensembles(imod) .ne. ensembles(jmod)) then
new_datasetnames(imod) = new_datasetnames(imod) + " " + \
ensembles(imod)
break
end if
end if
end if
end do
end do
datasetnames = new_datasetnames
delete(new_datasetnames)
end if
@bettina-gier do you want to try the suggested change? |
Testing now but just looking at the code I think the change is correct, my previous test was only with 2 ensemble members so I didn't have that issue. Also thinking if there's a better way to do it than splitting it in 2 loops. |
Sounds great, Bettina! I don't see a straightforward way to put them into the same loop(s) myself. But indeed one can put these two statements outside the loop (I updated above): experiments = metadata_att_as_array(info_items, "exp")
ensembles = metadata_att_as_array(info_items, "ensemble") |
Updated with your fix, works fine for me. Thanks for testing and finding the bug and fix! I found a way to leave it in the single loop to check if the name already has the experiment appended before appending again, I'll attach it if you want to see. However, your version results in more consistent naming as it will always have dataset - experiment - ensemble, whereas the 1-loop version will append first whatever differs first. ; Extend model name by ensemble/experiment on multiple occurence
if (.not. (dimsizes(datasetnames) .eq. \
count_unique_values(datasetnames))) then
new_datasetnames = datasetnames
experiments = metadata_att_as_array(info_items, "exp")
ensembles = metadata_att_as_array(info_items, "ensemble")
do imod = 0, dimsizes(datasetnames) - 1
do jmod = 0, dimsizes(datasetnames) - 1
if imod.eq.jmod then
continue
else
if (datasetnames(imod) .eq. datasetnames(jmod)) then
if ((experiments(imod) .ne. experiments(jmod)) .and. \
(all(str_split(datasetnames(imod), " ") .ne. \
experiments(jmod)))) then
new_datasetnames(imod) = new_datasetnames(imod) + " " + \
experiments(imod)
end if
if ((ensembles(imod) .ne. ensembles(jmod)) .and. \
(all(str_split(datasetnames(imod), " ") .ne. \
ensembles(jmod)))) then
new_datasetnames(imod) = new_datasetnames(imod) + " " + \
ensembles(imod)
end if
end if
end if
end do
end do
datasetnames = new_datasetnames
delete(new_datasetnames)
end if |
Great, thanks! Hope this will be fixed in the next release. |
@YanchunHe or @axel-lauer Do you think you could find someone to try this out and approve the pull request? If it gets approved and merged before Monday morning, it can still be included in v2.1 of the tool. |
I am testing this right now... |
We'll do the feature freeze around 3:30 PM CEST today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested these changes with just one and with multiple ensemble members of individual models. Works great! Thumbs up!
Before you start, read CONTRIBUTING.md and the guide for diagnostic developers.
Please discuss your idea with the development team before getting started, to avoid disappointment later. The way to do this is to open a new issue on GitHub. If you are planning to modify an existing functionality, please discuss it with the original author(s) by tagging them in the issue.
Tasks
Modified recipe/diagnostic
If you need help with any of the tasks above, please do not hesitate to ask by commenting in the issue or pull request.
Closes #1605
Fixing Klaus' issue with SMPI (and also perfmetrics) not supporting the use of a single model with different ensemble/experiment. Will also change dataset name in the relevant plots for differentiation.