Skip to content

Generalize ARCH_CYC to work with single cycle or list of cycles#4583

Closed
RussTreadon-NOAA wants to merge 17 commits intoNOAA-EMC:developfrom
RussTreadon-NOAA:feature/arch_cyc
Closed

Generalize ARCH_CYC to work with single cycle or list of cycles#4583
RussTreadon-NOAA wants to merge 17 commits intoNOAA-EMC:developfrom
RussTreadon-NOAA:feature/arch_cyc

Conversation

@RussTreadon-NOAA
Copy link
Contributor

@RussTreadon-NOAA RussTreadon-NOAA commented Feb 24, 2026

Description

The changes in this PR allow ARCH_CYC to be either a single integer cycle or a list of integer cycles.

Resolves #4565

Type of change

  • New feature (adds functionality)

Change characteristics

  • Is this change expected to change outputs (e.g. value changes to existing outputs, new files stored in COM, files removed from COM, filename changes, additions/subtractions to archives)? NO
  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? NO
  • Does this change require an update to any of the following submodules? NO

How has this been tested?

  • clone, build, and run modified C96C48_hybatmDA g-w CI on WCOSS2

Checklist

  • Any dependent changes have been merged and published
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have documented my code, including function, input, and output descriptions
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • This change is covered by an existing CI test or a new one has been added

RussTreadon-NOAA and others added 10 commits February 17, 2026 19:08
- Added Union and Tuple to typing imports
- Added _normalize_arch_cyc helper method for DRY ARCH_CYC normalization
- Refactored _arch_warm_start_increments with better validation and docstrings
- Refactored _arch_warm_restart_ics with improved error handling and case-insensitive RUN matching
- Replaced magic number 24 with HOURS_PER_DAY constant
- Enhanced docstrings with complete parameter and return documentation
- Improved variable names for clarity (cycle_hours, adjusted_cycle_hours)
- Added comprehensive error handling with descriptive messages
- Used .startswith() for more robust GDAS detection
- All changes validated with tests

Co-authored-by: RussTreadon-NOAA <[email protected]>
…hods

Refactor archive methods for robustness and consistency
…yc-usage

Generalize ARCH_CYC to support multiple cycle hours
Copy link
Contributor

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 generalizes the ARCH_CYC configuration parameter to support both single integer cycles and lists of cycles, allowing users to archive warm start restarts at multiple cycle hours (e.g., "0 12" for both 0Z and 12Z).

Changes:

  • Extended ARCH_CYC parsing in archive_tar_vars.py to handle integers, strings (space-separated), lists, and tuples
  • Added _normalize_arch_cyc() helper method in archive.py with robust type validation and error handling
  • Updated _arch_warm_start_increments() and _arch_warm_restart_ics() methods to iterate over lists of cycle hours instead of checking single values
  • Enhanced documentation with detailed numpy-style docstrings explaining parameters, returns, and the GDAS IC lag behavior

Reviewed changes

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

File Description
ush/python/pygfs/utils/archive_tar_vars.py Added inline ARCH_CYC parsing logic (lines 418-426) and updated archive timing boolean logic to use in and any() checks for list membership (lines 437, 448)
ush/python/pygfs/task/archive.py Added _normalize_arch_cyc() method with type validation, enhanced _arch_warm_start_increments() and _arch_warm_restart_ics() with improved error handling and list-based cycle hour checks, added comprehensive numpy-style docstrings

Copy link
Contributor

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

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

@RussTreadon-NOAA
Copy link
Contributor Author

@copilot open a new pull request to apply changes based on the comments in this thread

1 similar comment
@RussTreadon-NOAA
Copy link
Contributor Author

@copilot open a new pull request to apply changes based on the comments in this thread

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.

Generalize ARCH_CYC to allow a list of cycles

3 participants