Skip to content

copy any additional xml files in case into clone #4810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jedwards4b
Copy link
Contributor

Copy any additional xml files from case to clone.

Test suite:
Test baseline:
Test namelist changes:
Test status:

Fixes #4794

User interface changes?:

Update gh-pages html (Y/N)?:

@jedwards4b jedwards4b requested review from mnlevy1981 and Copilot June 25, 2025 13:29
@jedwards4b jedwards4b self-assigned this Jun 25, 2025
Copy link
Contributor

@Copilot 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 enhances the case cloning process by automatically copying any additional .xml files from the source case directory into the new clone.

  • Introduces a glob-based scan for all .xml files in the original case directory.
  • Copies any missing XML files into the cloned case using safe_copy.
  • Ensures existing files are not overwritten.
Comments suppressed due to low confidence (4)

CIME/case/case_clone.py:171

  • [nitpick] The variable name files is very generic; consider renaming it to xml_files to clearly convey its purpose.
        files = glob.glob(cloneroot + "/*.xml")

CIME/case/case_clone.py:172

  • [nitpick] Rename item to xml_file or file_path to better indicate that it represents the path to an XML file.
        for item in files:

CIME/case/case_clone.py:170

  • Add unit or integration tests to verify that this new XML copying logic correctly detects and copies additional XML files during case cloning.
        # if any other xml files exist in case directory copy them

CIME/case/case_clone.py:174

  • [nitpick] Consider adding a log or print statement here to report which XML files are being copied, improving visibility of the clone process.
                safe_copy(item, newcaseroot)

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Copy link
Contributor

@mnlevy1981 mnlevy1981 left a comment

Choose a reason for hiding this comment

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

Verified that create_clone in cesm3_0_beta06 does not copy env_postprocessing.xml but updating CIME to this branch does (and all env_*.xml files look correct in the new clone). Thanks!

@jedwards4b jedwards4b merged commit 6a80dcc into ESMCI:master Jun 25, 2025
7 checks passed
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.

create_clone does not copy env_postprocessing.xml to new case directory
3 participants