Skip to content

Conversation

@uramirez8707
Copy link
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

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 85.31%. Comparing base (ebc2b0b) to head (2b6a84b).

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   85.32%   85.31%   -0.01%     
==========================================
  Files          68       68              
  Lines        4490     4495       +5     
==========================================
+ Hits         3831     3835       +4     
- Misses        659      660       +1     
Flag Coverage Δ
unittests 85.31% <83.33%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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
Collaborator

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
Collaborator

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow reusable variable in the platform yaml

2 participants