-
Notifications
You must be signed in to change notification settings - Fork 112
Features/allow data heigts of type string #90
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| SPDX-License-Identifier: MIT | ||
| """ | ||
| import logging | ||
| import pandas as pd | ||
| from windpowerlib import (wind_speed, density, temperature, power_output, | ||
| tools) | ||
|
|
||
|
|
@@ -438,6 +439,11 @@ def run_model(self, weather_df): | |
| 'wind_speed' | ||
|
|
||
| """ | ||
| # Convert data heights to integer. In some case they are strings. | ||
| weather_df.columns = pd.MultiIndex.from_arrays([ | ||
| weather_df.columns.get_level_values(0), | ||
| weather_df.columns.get_level_values(1).astype(int)]) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe putting in a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me the error message is quite clear. It also indicates the exact value that causes the problem. For us it would be more difficult to indicate the problematic value. We could add something like "The heights should be convertible to numeric." but it in my opinion the original message is better. We could also check the array and show all problematic values but I think it is not worth it. |
||
|
|
||
| wind_speed_hub = self.wind_speed_hub(weather_df) | ||
| density_hub = (None if (self.power_output_model == 'power_curve' and | ||
| self.density_correction is False) | ||
|
|
||
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.
Why
intand notfloattype? In the provided example the values are integers but that shouldn't be a rule, right?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.
In my opinion the inaccuracy of the model is higher than the decimal digit. Therefore I would always prefer integer.
But at them moment floats are allowed and it might be easier to allow floats than to forbid them and to explain why.