Skip to content

Ensure Repeat variables _DD/_MM always have 2 digits#298

Draft
marcosbento wants to merge 1 commit intodevelopfrom
fix/two_digit_mm_dd
Draft

Ensure Repeat variables _DD/_MM always have 2 digits#298
marcosbento wants to merge 1 commit intodevelopfrom
fix/two_digit_mm_dd

Conversation

@marcosbento
Copy link
Collaborator

@marcosbento marcosbento commented Mar 17, 2026

Description

Ensure Repeat variables _DD/_MM always have 2 digits

This change applies to all Repeats that loop over time, including RepeatDate, RepeatDateTime and RepeatDateList -- related to #296.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

🌦️ >> Documentation << 🌦️
https://sites.ecmwf.int/docs/dev-section/ecflow/pull-requests/PR-298

@marcosbento
Copy link
Collaborator Author

@claude[agent] review this PR. Create a list of findings with potential improvements.

@Claude
Copy link

Claude AI commented Mar 17, 2026

@marcosbento I've opened a new pull request, #299, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR standardizes the formatting of generated repeat variables so that month/day components (_MM, _DD) are always zero-padded to 2 digits for time-based repeats (RepeatDate, RepeatDateTime, RepeatDateList), addressing the inconsistency reported in #296.

Changes:

  • Add internal helpers to format generated variable components with fixed digit widths (notably 2-digit month/day, and 2-digit time components).
  • Update RepeatDate / RepeatDateTime / RepeatDateList generated-variable computation to use zero-padded formatting.
  • Extend and adjust unit tests to assert the new formatting and validate generated variables across increments/expiry.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
libs/attribute/src/ecflow/attribute/RepeatAttr.cpp Introduces digit-format helpers and applies 2-digit formatting for generated repeat variables (date/time components).
libs/attribute/test/TestRepeat.cpp Adds/updates Boost tests to verify generated variables, including 2-digit _MM/_DD expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marcosbento marcosbento force-pushed the fix/two_digit_mm_dd branch from 9a28a68 to 0c41180 Compare March 17, 2026 16:47
This change applies to all Repeats that loop over time, including
RepeatDate, RepeatDateTime and RepeatDateList.

Re #296
@marcosbento marcosbento force-pushed the fix/two_digit_mm_dd branch from 0c41180 to f3e4f4e Compare March 17, 2026 16:58
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