Skip to content

Updates for AIGFS work - #957

Merged
maddenp-cu merged 5 commits into
ufs-community:mainfrom
maddenp-cu:updates-for-aigfs
Jul 29, 2026
Merged

Updates for AIGFS work#957
maddenp-cu merged 5 commits into
ufs-community:mainfrom
maddenp-cu:updates-for-aigfs

Conversation

@maddenp-cu

Copy link
Copy Markdown
Collaborator

Synopsis

Working on AIGFS, I noticed a possibility for three improvements:

  1. When calling uwtools.api.utils.run_shell_cmd(), the directory specified by cwd must already exist. As of this PR, and as in general in uwtools, the required directory is created if it does not already exist.
  2. Also in uwtools.api.utils.run_shell_cmd(), when taskname is provided, it was being prepended for only some of the log messages. This PR corrects that. See below for example bad output.
  3. The atomic() context manager is borrowed from wxvx, added to uwtools.utils.file, and exposed via the API. See the corresponding unit test for an example use case.

Here's some output from some AIGFS testing I was doing:

[2026-07-29T04:38:20]     INFO [GRIB index /tmp/aigfs/out/fstab.idx] Running: wgrib2 -s /etc/fstab >/tmp/aigfs/out/fstab.idx.tmp && mv /tmp/aigfs/out/fstab.idx.tmp /tmp/aigfs/out/fstab.idx
[2026-07-29T04:38:20]     INFO   in directory
[2026-07-29T04:38:20]     INFO     /tmp/aigfs/out
[2026-07-29T04:38:20]    ERROR [GRIB index /tmp/aigfs/out/fstab.idx] Failed with status: 127
[2026-07-29T04:38:20]    ERROR [GRIB index /tmp/aigfs/out/fstab.idx] Output:
[2026-07-29T04:38:20]    ERROR [GRIB index /tmp/aigfs/out/fstab.idx]   wgrib2: symbol lookup error: wgrib2: undefined symbol: g2c_enc_aec

Never mind the error, but note that the second and third log messages anomalously are not prefixed with the taskname.

Type

  • Bug fix (corrects a known issue)
  • 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 Jul 29, 2026
Comment thread src/uwtools/tests/api/test_utils.py
Comment thread src/uwtools/tests/utils/test_processing.py
Comment thread src/uwtools/tests/utils/test_processing.py
Comment thread src/uwtools/utils/file.py
@maddenp-cu
maddenp-cu marked this pull request as ready for review July 29, 2026 05:34
@maddenp-cu
maddenp-cu merged commit 0056f08 into ufs-community:main Jul 29, 2026
2 checks passed
@maddenp-cu
maddenp-cu deleted the updates-for-aigfs branch July 29, 2026 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