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

Add test for v3_to_v4 input file converters #880

Merged
merged 7 commits into from
May 6, 2024

Conversation

paulf81
Copy link
Collaborator

@paulf81 paulf81 commented Apr 12, 2024

Add CI testing of v3 to v4 conversions

I was thinking as we add features to v4 it'll be good to have some testing that the converter from v3 to v4 is keeping up if we we add new aspects to v4. The test I added works by:

  • Keeping a copy in tests of input files from the v3 branch of FLORIS
  • Making a copy into that folder of the current converter scripts
  • Running those scripts on the floris and turbine inputs
  • Opening a FLORIS model on the converted script

One special case handled is that the v3 yaml points to a turbine_type "XXXXX" which is replaced after conversion with a !include pointing to the newly created v4 turbine file. Originally I had the !include in the v3 input but this gets merged to early and the whole turbine file ends up in the v4 floris yaml.

Related issue

Inspired by #878

@paulf81 paulf81 added the enhancement An improvement of an existing feature label Apr 12, 2024
@paulf81 paulf81 requested a review from misi9170 April 12, 2024 21:51
@paulf81 paulf81 self-assigned this Apr 12, 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.

Just requesting we also run the loaded v4 fmodel to be sure; otherwise, this looks great, thanks

file.write(filedata)

# Now confirm that the converted file can be loaded by FLORIS
_ = FlorisModel(filename_v4_floris)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should also confirm that it runs, because I'm not 100% sure that just loading it catches all possible missing fields? I don't think we should set anything, just instantiate to fmodel and run.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good suggestion! Adding now

@misi9170 misi9170 self-requested a review April 15, 2024 15:04
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.

Thanks!

# Run the converter on the floris file
os.system(f"python convert_floris_input_v3_to_v4.py {filename_v3_floris}")

# Go through the file filename_v4_turbine and where the place-holder string "XXXXX" is found
Copy link
Collaborator

@misi9170 misi9170 Apr 15, 2024

Choose a reason for hiding this comment

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

Sorry, just noticed maybe a typo here: should this comment be referring to filename_v4_floris rather than filename_v4_turbine?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, thanks!

@misi9170 misi9170 changed the title Feature/test v3 v4 converter Add test for v3_to_v4 input file converters Apr 15, 2024
@paulf81 paulf81 merged commit 7727b17 into NREL:develop May 6, 2024
8 checks passed
@paulf81 paulf81 deleted the feature/test_v3_v4_converter branch May 6, 2024 14:52
@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