wind-python / windpowerlib

The windpowerlib is a library to model the output of wind turbines and farms.
https://oemof.org/
MIT License
305 stars 103 forks source link

Error in running modelchain_example.py #110

Closed MartaFochesato closed 3 years ago

MartaFochesato commented 3 years ago

I have tried to run the code modelchain_example.py present in the example folder, but I got the following error:

Traceback (most recent call last): File "C:\Users\marta\PycharmProjects\Renewables\WindPowerForecast\WindEnergy_calculator.py", line 329, in my_wind_turbine_model = ModelChain(my_wind_turbine, **modelchain_data).run_model(weather) File "C:\Users\marta\PycharmProjects\Renewables\WindPowerForecast\venv\lib\site-packages\windpowerlib\modelchain.py", line 443, in run_model wind_speed_hub = self.wind_speed_hub(weather_df) File "C:\Users\marta\PycharmProjects\Renewables\WindPowerForecast\venv\lib\site-packages\windpowerlib\modelchain.py", line 317, in wind_speed_hub min(range(len(weather_df['wind_speed'].columns)), File "C:\Users\marta\PycharmProjects\Renewables\WindPowerForecast\venv\lib\site-packages\windpowerlib\modelchain.py", line 318, in key=lambda i: abs(weather_df['wind_speed'].columns[i] - TypeError: unsupported operand type(s) for -: 'str' and 'int'

How can I solve it?

uvchik commented 3 years ago

We do need some more information to help you.

What version of windpowerlib do you use? From where did you get the example?

It is important that the example is compatible to your installed version. To be sure you can specify your installed version on github and download the according example. If you modified the example you should mention that and explain what you have done.

MartaFochesato commented 3 years ago

I am using version 0.2.0 of windpowerlib and running the example modelchain_example.py taken from wind python/windpowerlib/examples/modelchain_example.py

How can I see if the example is compatible with the version that I am using? Thank you!

uvchik commented 3 years ago

The version should show "v0.2.0" and NOT "dev". Open the dialog (red circle) and choose Tags -> v0.2.0. Then download the example. Or download https://codeload.github.com/wind-python/windpowerlib/zip/v0.2.0

Bildschirmfoto_2020-11-18_19-38-59

uvchik commented 3 years ago

@MartaFochesato Please close this issue if your problems are solved.

MartaFochesato commented 3 years ago

Thank you a lot!

MartaFochesato commented 3 years ago

Dear all,

Sorry I forgot to do that, I have just closed the issue. Thank you again for the support.

Best,

-Marta On Tue, 1 Dec 2020 at 16:28, Uwe Krien notifications@github.com wrote:

@MartaFochesato https://github.com/MartaFochesato Please close this issue if your problems are solved.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/wind-python/windpowerlib/issues/110#issuecomment-736625897, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALJCACGC3UMIG6CBKAIC5G3SSUDSTANCNFSM4T2BPBKQ .