Skip to content

Fix suite data parsing - #257

Merged
James Bruten (james-bruten-mo) merged 1 commit into
MetOffice:mainfrom
yaswant:fix-suite-report
Oct 6, 2026
Merged

James Bruten (james-bruten-mo) merged 1 commit into
MetOffice:mainfrom
yaswant:fix-suite-report

Conversation

@yaswant

@yaswant Yaswant Pradhan (yaswant) commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

PR Summary

  • Fix suite data parsing
  • Avoid using legacy structures from the typing module (Optional and Union kept for Python 3.9 support)

Code Reviewer: James Bruten (@james-bruten-mo)

We have some formatting issues in generated trac.log - the groups are not parsed correctly. The issue is that the string contains spaces after the commas and potential single quotes inside the string, so simply stripping brackets/quotes from the entire string and then splitting by "," leaves raw quotes and spaces attached to the inner elements, e.g.,

['developer', 'ex1a_cce_um_safe_omp-seukv_noda_edgepert'] becomes
["developer'", " 'ex1a_cce_um_safe_omp-seukv_noda_edgepert"]

Here, I have introduced a fix using Python's built-in ast.literal_eval, which safely parses the string directly into a true Python list.

Code Quality Checklist

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings
  • All automated checks in the CI pipeline have completed successfully

Testing

  • This change has been tested appropriately (see example)

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)

AI Assistance and Attribution

NA

  • 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)

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Security considerations have been addressed
  • Performance impact is acceptable

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.

Now that the cylc install we're using is using a more recent version of python this is fine to be upgraded

@james-bruten-mo
James Bruten (james-bruten-mo) merged commit e58cf2b into MetOffice:main Oct 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants