Skip to content

Atomic improvements and null driver executable - #973

Merged
maddenp-cu merged 17 commits into
ufs-community:mainfrom
maddenp-cu:atomic-improvements-and-null-executable
Sep 1, 2026
Merged

Atomic improvements and null driver executable#973
maddenp-cu merged 17 commits into
ufs-community:mainfrom
maddenp-cu:atomic-improvements-and-null-executable

Conversation

@maddenp-cu

@maddenp-cu maddenp-cu commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Synopsis

  1. Support null as a value for executable in driver configs, to support all-Python drivers.
  2. Give the atomic context manager a way to avoid creating the final file at all.

In re: item 1, there are reasons for requiring a null value instead of just omitting the key:

  • In the case of <driver>.execution.executable, executable is the only required key in the execution: block, so making it optional would make the whole execution: block potentially also optional. We could consider that, but:
  • Having a null value signals intent, while a missing executable key (or a missing execution: block) looks potentially like an omission.
  • There are other places where a null value might be useful in the future to signal that certain behavior is unwanted. Currently, the uwtools mechanism for this is the !remove tag, but this must potentially be repeated many times in an override config if the same optional value (e.g. account under many task subblocks in a Rocoto block) should be suppressed. Compare to a case where one might set user.account to a real account name in a base config and have many account: '{{ user.account }}' references to it in Rocoto blocks. In this case, an override config would only need to override the single user.account value, setting it to null. Of course, supporting Python code would need to take appropriate action when seeing a null value in supported contexts -- as is done in this PR for executable: null. So allowing executable: null here is a proof-of-concept exercise (as well as potentially improving a real use case in uw-aigfs, but that's a separate PR).

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.
  • Where helpful, I have written comments in this PR's Files changed view to assist reviewers.

@maddenp-cu maddenp-cu self-assigned this Aug 31, 2026
Comment thread src/uwtools/tests/drivers/test_driver.py
Comment thread src/uwtools/utils/file.py
Comment thread src/uwtools/utils/tasks.py
Comment thread src/uwtools/utils/tasks.py
Comment thread src/uwtools/utils/tasks.py
Comment thread src/uwtools/tests/utils/test_tasks.py
@maddenp-cu
maddenp-cu marked this pull request as ready for review September 1, 2026 14:48
Comment thread src/uwtools/drivers/driver.py

@christinaholtNOAA christinaholtNOAA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@maddenp-cu
maddenp-cu merged commit 6c0dedd into ufs-community:main Sep 1, 2026
2 checks passed
@maddenp-cu
maddenp-cu deleted the atomic-improvements-and-null-executable branch September 1, 2026 19:01
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.

2 participants