Skip to content

Add Jedi string method to datetime - #693

Open
DanStoneMO wants to merge 12 commits into
MetOffice:mainfrom
DanStoneMO:jedi-time-convert
Open

Add Jedi string method to datetime#693
DanStoneMO wants to merge 12 commits into
MetOffice:mainfrom
DanStoneMO:jedi-time-convert

Conversation

@DanStoneMO

@DanStoneMO DanStoneMO commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Sci/Tech Reviewer:
Code Reviewer: mo-lucy-gordon

This is a small PR adding a new method to the datetime object, allowing it to be written as a ISO datetime string compatible with JEDI systems. The process of converting between LFRic and JEDI compatible datetime strings is currently hard-coded in lfric-jedi, which would be bad for maintainability down the line.

The new method is largely a copy of the current to_string one, just adjusting the characters used in the output string.

linked PRs

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

  • I have tested this change locally, using the LFRic Apps rose-stem suite
  • If any tests fail (rose-stem or CI) the reason is understood and acceptable (e.g. kgo changes)
  • I have added tests to cover new functionality as appropriate (e.g. system tests, unit tests, etc.)
  • Any new tests have been assigned an appropriate amount of compute resource and have been allocated to an appropriate testing group (i.e. the developer tests are for jobs which use a small amount of compute resource and complete in a matter of minutes)

Test results, via mo-bundle's mobbalt opt: https://cylchub/services/cylc-review/taskjobs/daniel.stone/?suite=mob-jedi-time-convert-mobbalt-2

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

@DanStoneMO DanStoneMO self-assigned this Aug 4, 2026
@DanStoneMO DanStoneMO added the Linked Jedi This PR is linked to a Jedi PR - this will be managed by the DA team label Aug 4, 2026

@ss421 Steven Sandbach (ss421) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the update - looks good. See small comment below.

procedure, public :: add_seconds

procedure, public :: to_string
procedure, public :: to_jedi_string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would be inclined to rename this method to: to_iso_string.

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

Labels

Linked Jedi This PR is linked to a Jedi PR - this will be managed by the DA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants