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

Add public config_file attribute to Config classes #679

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

maddenp-noaa
Copy link
Collaborator

Synopsis

During some design discussion today with @uturuncoglu, we considered a kind of hybrid readiness criterion for uwtools driver tasks that would specify both that 1. The expected output file exists, and 2. It is newer than the driver's config file. This would permit definition of assets that mimic the behavior of make, where action is taken either if the output does not exist, or if it is older than the source file. This way, task designers could choose to have drivers update output files if the config file has been changed. (More nuanced criteria would be possible, too, like checking if a specific section of the config had changed, but that would take more work.)

This PR simply exposes a read-only config_file attribute on Config objects, wrapping the private _config_file attribute. Driver could use the path named by this attribute to get a timestamp on the config file to compare to output files. Config objects not instantiated from files (e.g. from dict objects) will return None.

Type

  • Enhancement (adds new functionality)

Impact

  • This is a non-breaking change (existing functionality continues to work as expected)

Checklist

  • I have added myself and any co-authors to the PR's Assignees list.
  • I have reviewed the documentation and have made any updates necessitated by this change.

@maddenp-noaa maddenp-noaa merged commit 0af13bb into ufs-community:main Dec 18, 2024
2 checks passed
@maddenp-noaa maddenp-noaa deleted the config-file-attribute branch December 18, 2024 18:07
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.

3 participants