Skip to content

Platform yaml#682

Open
uramirez8707 wants to merge 8 commits intoNOAA-GFDL:mainfrom
uramirez8707:platform_yaml
Open

Platform yaml#682
uramirez8707 wants to merge 8 commits intoNOAA-GFDL:mainfrom
uramirez8707:platform_yaml

Conversation

@uramirez8707
Copy link
Copy Markdown
Contributor

@uramirez8707 uramirez8707 commented Nov 25, 2025

Describe your changes

Updates code to allow for platform yaml to contain reusable variable that can be used in the compile yaml.

Issue ticket number and link (if applicable)

Fixes #681

Checklist before requesting a review

  • I ran my code
  • I tried to make my code readable
  • I tried to comment my code
  • I wrote a new test, if applicable
  • I wrote new instructions/documentation, if applicable
  • I ran pytest and inspected it's output
  • I ran pylint and attempted to implement some of it's feedback
  • No print statements; all user-facing info uses logging module

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.15%. Comparing base (3b358f2) to head (9cd3413).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
fre/yamltools/helpers.py 80.00% 1 Missing ⚠️
fre/yamltools/info_parsers/compile_info_parser.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #682      +/-   ##
==========================================
- Coverage   84.15%   84.15%   -0.01%     
==========================================
  Files          71       71              
  Lines        4955     4960       +5     
==========================================
+ Hits         4170     4174       +4     
- Misses        785      786       +1     
Flag Coverage Δ
unittests 84.15% <83.33%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
fre/yamltools/helpers.py 91.17% <80.00%> (-0.89%) ⬇️
fre/yamltools/info_parsers/compile_info_parser.py 92.64% <85.71%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b358f2...9cd3413. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uramirez8707 uramirez8707 marked this pull request as ready for review December 1, 2025 15:37
@singhd789 singhd789 self-requested a review December 1, 2025 17:36
if kc in yml_dict.keys():
del yml_dict[kc]

# Clean up any fre_properties in the platforms
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.

Dropping a test like this into test_helpers.py might help out the code coverage report:

def test_yaml_clean():
    input_yaml = {
                  "name": "test"
                  "platform": "ptest"
                  "target": "ttest"
                  "fre_properties": ["some", "list"]
                  "build": {"compile": "yaml1", "platform": "yaml2"}
                  "experiments": ["some", "list"]
                  "compile": {"info": "info1"}
                  "platforms": [{"name": "plat1"},
                                {"name": "plat2", "fre_properties": ["another", "list"]}]
                 }

    # After cleaning - yaml should look like this
    expected_yaml = {
                     "name": "test"
                     "platform": "ptest"
                     "target": "ttest"
                     "compile": {"info": "info1"}
                     "platforms": [{"name": "plat1"},
                                   {"name": "plat2"}]
                    }

    # Clean yaml
    output_yaml = clean_yaml(input_yaml)

    assert output_yaml == expected_yaml

# Merge compile into combined file to create updated yaml_content/yaml
try:
yaml_content = self.combine_compile(yaml_content)
yaml_content = self.combine_platforms(yaml_content)
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.

Though not necessary, it might be nice to have the functions in the class above follow how the yamls are combined here, which means 2 changes:

  1. Just switching the order of the functions around in InitCompileYaml in this file
  2. Switching around the order that class follows in abstract_classes.py

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow reusable variable in the platform yaml

3 participants