Skip to content

Comments

Add new OS utils for DRY file handling#100

Merged
mxkpp merged 7 commits intodevelopmentfrom
maxkipp-refactor-regrid-py-dryify-3
Feb 13, 2026
Merged

Add new OS utils for DRY file handling#100
mxkpp merged 7 commits intodevelopmentfrom
maxkipp-refactor-regrid-py-dryify-3

Conversation

@mxkpp
Copy link

@mxkpp mxkpp commented Feb 13, 2026

Expands OS utils for further DRYifying operations of file handle closing and file removal.

Applies the new OS utils throughout to regrid.py.

Additions

  • Various functions added to os_utils.py

Removals

Changes

  • Added option to ignore FileNotFoundError during attempts to remove a file
  • Replaced many copies of repeated file handling blocks in regrid.py with higher-level equivalent calls to the new functions.
  • Details of log messages around file handling are now determined dynamically from the file handle provided.

Testing

  1. Ran calibrations and forecasts in RTE and watched log messages after building with ENV FORCING_LOGLEVEL=DEBUG

Screenshots

Notes

Todos

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices (see checklist below 👇)
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist

Target Environment support

  • Linux

@mxkpp mxkpp marked this pull request as ready for review February 13, 2026 19:00
Copy link

@mdeshotel mdeshotel left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@mxkpp mxkpp merged commit ea6bf4c into development Feb 13, 2026
6 checks passed
@mxkpp mxkpp deleted the maxkipp-refactor-regrid-py-dryify-3 branch February 13, 2026 19:51
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