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

Accept str values for config, target_dir in file tool #553

Merged

Conversation

maddenp-noaa
Copy link
Contributor

@maddenp-noaa maddenp-noaa commented Jul 31, 2024

Synopsis

  1. In addition to the copy() and link() convenience functions we provide via uwtools.api.file, we now also provide direct access to the Copier and Linker objects, so that external drivers can instantiate them and use their tasks directly, e.g. yielding them as dependency tasks in their own iotaa tasks. We already ensured that str values provided by users in copy() or link() calls are converted to the Path objects expected by Copier and Linker. But it will be convenient for users to be able to provide str values when they directly call the constructors of those classes. So, the necessary conversions are added.
  2. We previously renamed FileCopier -> Copier (and similarly FileLinker -> Linker) to avoid the awkward repetition in e.g. uwtools.file.FileLinker. FileStager -> Stager is added here.

Type

  • Code maintenance (refactoring, etc. without behavior change)

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 self-assigned this Jul 31, 2024
@maddenp-noaa maddenp-noaa changed the title Accept str value for target_dir in file tool Accept str values for config, target_dir in file tool Jul 31, 2024
src/uwtools/api/file.py Show resolved Hide resolved
src/uwtools/file.py Show resolved Hide resolved
Copy link
Contributor

@christinaholtNOAA christinaholtNOAA left a comment

Choose a reason for hiding this comment

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

LGTM.

@maddenp-noaa maddenp-noaa merged commit ca75423 into ufs-community:main Aug 1, 2024
2 checks passed
@maddenp-noaa maddenp-noaa deleted the file-tool-accept-str-target-dir branch August 1, 2024 14:44
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.

5 participants