-
Notifications
You must be signed in to change notification settings - Fork 124
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
Fix provenance of NCL figures created using the log_provenance function #2279
Conversation
General question on this before the review to make sure we are on the same page. What do you mean by
? I always use the attribute
provenance_logger['plot_file`] = 'path_to_plot.png'
with ProvenanceLogger(cfg) as provenance_logger:
provenance_logger.log('path_to_dataset.nc', provenance_record)
with ProvenanceLogger(cfg) as provenance_logger:
provenance_logger.log('path_to_plot.png', provenance_record)
with ProvenanceLogger(cfg) as provenance_logger:
provenance_logger.log('path_to_dataset.nc', provenance_record)
with ProvenanceLogger(cfg) as provenance_logger:
provenance_logger.log('path_to_plot.png', provenance_record) ? |
Good questions @schlunma and my apologies for the confusion. The only working way of writing provenance at the moment is the last option you describe: log the provenance for every file separately. The documentation that describes that lives here: https://docs.esmvaltool.org/en/latest/community/diagnostic.html#provenance-items-provided-by-the-diagnostic-script. Unfortunately, it looks like I forgot to update the documentation that you linked, I'll update that too. Indeed using |
I created a pull request with updated documentation here: ESMValGroup/ESMValCore#1305 |
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.
Code looks good and (two) test recipes ran successfully π
Before this change, NCL diagnostics only output provenance for the nc files; now, they also output provenance information for the plot files without any change in the diagnostics themselves. Great job!
One question: Would it be possible to implement a similar feature for the python provenance logging to support the "deprecated" interface? I think this would be really helpful. There are so many diagnostic that use this old version (at least 10+ diagnostics that I have written) and I guess most developers (e.g., I) do not have the time to overhaul these diagnostics.
I'll have a look at the Python interface and see if it's easy to fit something in. |
Description
Logging provenance using the
plot_file
entry of the corresponding NetCDF file is a buggy feature of ESMValCore. It is also not supported by the functionality that creates the index.html page. This pull request improves the NCLlog_provenance
function so it writes a separate entry for image files and they are nice shown in the resulting webpage.Before you get started
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the π Technical or π§ͺ Scientific review.
To help with the number of pull requests: