-
Notifications
You must be signed in to change notification settings - Fork 155
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
Conversation
There was a problem hiding this 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
tests/convert_v3_to_v4_test.py
Outdated
file.write(filedata) | ||
|
||
# Now confirm that the converted file can be loaded by FLORIS | ||
_ = FlorisModel(filename_v4_floris) |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion! Adding now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
tests/convert_v3_to_v4_test.py
Outdated
# 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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, thanks!
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:
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