Skip to content

Move shellouts#40

Open
Pierre-siddall wants to merge 93 commits intoMetOffice:mainfrom
Pierre-siddall:move-shellouts
Open

Move shellouts#40
Pierre-siddall wants to merge 93 commits intoMetOffice:mainfrom
Pierre-siddall:move-shellouts

Conversation

@Pierre-siddall
Copy link
Contributor

@Pierre-siddall Pierre-siddall commented Mar 10, 2026

PR Summary

Code Reviewer: @ericaneininger

This PR aims to unify shell out commands across MOCI so that they all have the same semantics. The changes involved include adding a separate library to handle shell operations and replacing current shell operations with a newly implemented exec_subprocess function and subsequently also deprecates legacy shell out commands to be redirected to use exec_subprocess in mocilib .

closes #12
closes #23

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid undertanding and enhance the
    readability of the code
  • My changes generate no new warnings

Testing

  • I have tested this change locally, using the Moci rose-stem suite
  • If any tests fail (rose-stem or CI) the reason is understood and
    acceptable (eg. kgo changes)
  • I have added tests to cover new functionality as appropriate (eg. system
    tests, unit tests, etc.)

Test Suite Results - moci - test-mocilib/run2

Suite Information

Item Value
Suite Name test-mocilib/run2
Suite User pierre.siddall
Workflow Start 2026-03-18T13:31:20
Groups Run all
Dependency Reference Main Like
moci Pierre-siddall/moci@move-shellouts False
SimSys_Scripts MetOffice/SimSys_Scripts@main True

Task Information

✅ succeeded tasks - 116

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable
    performance measurements have been conducted

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance
    of Generative AI tool name (e.g., Met Office Github Copilot Enterprise,
    Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the
    Simulation Systems AI policy
    (including attribution labels)

Documentation

  • Where appropriate I have updated documentation related to this change and
    confirmed that it builds correctly

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

Copy link
Collaborator

@ericaneininger ericaneininger left a comment

Choose a reason for hiding this comment

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

Can you please run ruff over your changes? I do not know what the default settings are in terms of styling but some consistency in the spacing before/after commas and operators would be appreciated.

Unit tests -

  • These should be added as a task as part of the "tests" group in rose-stem. At the moment it is not obvious how to run these from the command line, which is necessary for this.
    • Either add a top level test.py executable (see examples in Postprocessing/unittests/test_postproc or Coupled_Drviers/unittests/test.py, or else add an if __name__ == "__main__": unittest.main() to unittests/test_shellout.py
    • Please change the name of the tested method to remove the _ prefix
    • Please ensure that all tests pass - there should be one test per path through the code. Testing to check we have an expected failure counts as a pass!
    • If possible please assert which exception path we've gone through.

@Pierre-siddall Pierre-siddall marked this pull request as draft March 10, 2026 16:24
@Pierre-siddall Pierre-siddall marked this pull request as ready for review March 18, 2026 15:44
@Pierre-siddall
Copy link
Contributor Author

@ericaneininger hopefully this should be ready to go on now, let me know if there's anything else that is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate old shellout commands Move shell out commands to a separate module/library

3 participants