-
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
Validate and test wind direction and wind speed #793
Conversation
@rafmudaf and @misi9170 , just noticed this is causing some reg_tests to fail, this is maybe ok though, the code that fails includes lines like this:
This makes me think the validator should check for length 1, since this will get projected upwards right? |
|
tests/floris_interface_test.py
Outdated
@@ -15,6 +15,22 @@ def test_read_yaml(): | |||
assert isinstance(fi, FlorisInterface) | |||
|
|||
|
|||
def test_reinitialize(): |
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.
Let's test this on the FlowField class directly rather than indirectly through the FlorisInterface
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.
Will do!
Sorry for the accidental close! Don't know how that happened. Reopened. |
For what it's worth, considering the format for array-inputs (see #794) is a scope creep. I think it would be reasonable to maintain the current design here, and develop the design for the array inputs further in the discussion thread. The current design is that wind directions and wind speeds must be the same size, and other array-inputs can be an array of length 1 or |
The problem I hit is that the reg tests don't currently follow this convention, so I would have to change them |
Based on the design we had chosen for v4, the bug is in both the regression tests and the FlowField validators. The regression tests should also be fixed in all of the rotation tests. |
OK I can fix both right now |
Maybe it's more accurate to say the bug is in the FlowField validators and you've fixed those. Then, an error was raised, as it should have been, because the regression tests were incorrectly calling the API. |
agreed |
hi @rafmudaf I reconfigured the pull request around this discussion, is this better? |
Thanks for updating, it looks good to me |
Validate and test wind direction and wind speed
In the development of #783, @misi9170 noticed that running this code:
Which has the wrong number of dimensions for wind speed and direction, produces an error related to turbulence intensity. Experimenting with the code I found that, contrary to expectations, passing in wind directions and wind speeds of different length does not produce an error, instead f_index = len(wind_directions), which is confusing. Then also, having extra dimensions in wd/ws does not immediately error, explaining the complicated errors later.
This pull request attempts to clarify the issue by:
(Note TI already had a validator/test comparing lengths)
These changes are made in flow_field.py so they will catch the same errors in reinitialize as above, but also different lengths of values in an input yaml
Finally:
Impacted areas of the software
flow_field.py
tests/