Add public config_file attribute to Config classes #679
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofmake
, 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 onConfig
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. fromdict
objects) will returnNone
.Type
Impact
Checklist