Skip to content
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

Ignore includes in v3->v4 conversions #904

Merged
merged 3 commits into from
May 8, 2024

Conversation

paulf81
Copy link
Collaborator

@paulf81 paulf81 commented May 7, 2024

Ignore includes in v3->v4 conversions

Currently when you convert an input yaml from v3 -> v4 using the converter script, any !include statements to turbine files get unpacked within the yaml file and then dumped into the file. While this can work, it means that the yaml file can get quite long if there were a number of turbines listed, and also the yaml is no longer tied to the turbine file, and changes made to the turbine file will have to be made to each instance within the yaml.

This pull pull request modifies the yaml load/dump routines within the converter to pass through those include statements directly. It further updates the convert script test to confirm the new methods are working. Previously, to avoid this issue a sentinal "XXXXX" string was used but this can now go back to the turbine yaml name

@paulf81 paulf81 added the enhancement An improvement of an existing feature label May 7, 2024
@paulf81 paulf81 requested a review from misi9170 May 7, 2024 22:00
@paulf81 paulf81 self-assigned this May 7, 2024
Copy link
Collaborator

@misi9170 misi9170 left a comment

Choose a reason for hiding this comment

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

Very minor suggestion for an improved comment; otherwise, looks great and runs as expected, thanks @paulf81 !


# Open the output file and loop through line by line
# if a line contains the substring !include, then strip all
# occurrences of ' from the line
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment could perhaps state that the yaml load / dump sequence adds the string marks ' ' to the !include statements, which then need to be removed from the final output file. I didn't follow that at first. Otherwise, this looks great!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do!

@paulf81 paulf81 merged commit a313286 into NREL:develop May 8, 2024
8 checks passed
@paulf81 paulf81 deleted the feature/ignore_include branch May 8, 2024 23:06
@misi9170 misi9170 mentioned this pull request Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants