Unable to use windpowerlib in Anaconda Environment with PyCharm?












0















I am trying to refer to the windpowerlib documentation (https://windpowerlib.readthedocs.io/en/stable/getting_started.html#examplereference-label) and using the sample Python Script and Example Weather Data File. I have created a new virtual environment within Anaconda 3 called windproject1, and installed the windpowerlib in that directory via pip.



I execute the example code in PyCharm Community Edition 2018.1 available on the aforesaid link which isn't compiling successfully. I am mentioning the 2 methods which are likely causing the error as per the Stacktrace below:-



def initialise_wind_turbines():
r"""
Initialises two :class:`~.wind_turbine.WindTurbine` objects.

Function shows two ways to initialise a WindTurbine object. You can either
specify your own turbine, as done below for 'myTurbine', or fetch power
and/or power coefficient curve data from data files provided by the
windpowerlib, as done for the 'enerconE126'.
Execute ``windpowerlib.wind_turbine.get_turbine_types()`` or
``windpowerlib.wind_turbine.get_turbine_types(
filename='power_coefficient_curves.csv')`` to get a list of all wind
turbines for which power and power coefficient curves respectively are
provided.

Returns
-------
Tuple (WindTurbine, WindTurbine)

"""

# specification of own wind turbine (Note: power coefficient values and
# nominal power have to be in Watt)
myTurbine = {
'turbine_name': 'myTurbine',
'nominal_power': 3e6, # in W
'hub_height': 105, # in m
'rotor_diameter': 90, # in m
'power_curve': pd.DataFrame(
data={'values': [p * 1000 for p in [
0.0, 26.0, 180.0, 1500.0, 3000.0, 3000.0]], # in W
'wind_speed': [0.0, 3.0, 5.0, 10.0, 15.0, 25.0]}) # in m/s
}
# initialise WindTurbine object
my_turbine = WindTurbine(**myTurbine)

# specification of wind turbine where power curve is provided
# if you want to use the power coefficient curve add
# {'fetch_curve': 'power_coefficient_curve'} to the dictionary
enerconE126 = {
'turbine_name': 'ENERCON E 126 7500', # turbine name as in register
'hub_height': 135, # in m
'rotor_diameter': 127 # in m
}
# initialise WindTurbine object
e126 = WindTurbine(**enerconE126)

return my_turbine, e126



def run_basic_example():
r"""
Run the basic example.

"""
weather = get_weather_data('weather.csv')
my_turbine, e126 = initialise_wind_turbines()
calculate_power_output(weather, my_turbine, e126)
plot_or_print(my_turbine, e126)


if __name__ == "__main__":
run_basic_example()


But am unable to compile it successfully. I get the errors as evident from the stack trace below:-



/Users/joyjitchatterjee/anaconda3/envs/windproject1/bin/python /Users/joyjitchatterjee/Desktop/windAnalysis/test.py
Traceback (most recent call last):
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 243, in <module>
run_basic_example()
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 237, in run_basic_example
my_turbine, e126 = initialise_wind_turbines()
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 111, in initialise_wind_turbines
my_turbine = WindTurbine(**myTurbine)
TypeError: __init__() got an unexpected keyword argument 'name'

Process finished with exit code 1


The key thing to mention here is that I have a folder on my desktop (/Users/joyjitchatterjee/Desktop/example) with the weather.csv file. Also, the code I am compiling is stored in the folder (/Users/joyjitchatterjee/Desktop/windAnalysis) with the name test.py. I am not sure why the __init__() dunder method is giving this weird error, and if I need to specify any explicit argument instead of name to run the example code. I am new to using both windpowerlib and Python with packages like these, and any help in this regard would be highly appreciated. Thanks!










share|improve this question




















  • 1





    The vast majority of that code is irrelevant to the issue. Please remove and boil it down to the actual issue.

    – roganjosh
    Jan 1 at 15:33











  • @roganjosh Thanks for the suggestion. I have removed the redundant code and now only 2 methods which are causing the error as per stacktrace are there.

    – Joyjit Chatterjee
    Jan 1 at 15:41
















0















I am trying to refer to the windpowerlib documentation (https://windpowerlib.readthedocs.io/en/stable/getting_started.html#examplereference-label) and using the sample Python Script and Example Weather Data File. I have created a new virtual environment within Anaconda 3 called windproject1, and installed the windpowerlib in that directory via pip.



I execute the example code in PyCharm Community Edition 2018.1 available on the aforesaid link which isn't compiling successfully. I am mentioning the 2 methods which are likely causing the error as per the Stacktrace below:-



def initialise_wind_turbines():
r"""
Initialises two :class:`~.wind_turbine.WindTurbine` objects.

Function shows two ways to initialise a WindTurbine object. You can either
specify your own turbine, as done below for 'myTurbine', or fetch power
and/or power coefficient curve data from data files provided by the
windpowerlib, as done for the 'enerconE126'.
Execute ``windpowerlib.wind_turbine.get_turbine_types()`` or
``windpowerlib.wind_turbine.get_turbine_types(
filename='power_coefficient_curves.csv')`` to get a list of all wind
turbines for which power and power coefficient curves respectively are
provided.

Returns
-------
Tuple (WindTurbine, WindTurbine)

"""

# specification of own wind turbine (Note: power coefficient values and
# nominal power have to be in Watt)
myTurbine = {
'turbine_name': 'myTurbine',
'nominal_power': 3e6, # in W
'hub_height': 105, # in m
'rotor_diameter': 90, # in m
'power_curve': pd.DataFrame(
data={'values': [p * 1000 for p in [
0.0, 26.0, 180.0, 1500.0, 3000.0, 3000.0]], # in W
'wind_speed': [0.0, 3.0, 5.0, 10.0, 15.0, 25.0]}) # in m/s
}
# initialise WindTurbine object
my_turbine = WindTurbine(**myTurbine)

# specification of wind turbine where power curve is provided
# if you want to use the power coefficient curve add
# {'fetch_curve': 'power_coefficient_curve'} to the dictionary
enerconE126 = {
'turbine_name': 'ENERCON E 126 7500', # turbine name as in register
'hub_height': 135, # in m
'rotor_diameter': 127 # in m
}
# initialise WindTurbine object
e126 = WindTurbine(**enerconE126)

return my_turbine, e126



def run_basic_example():
r"""
Run the basic example.

"""
weather = get_weather_data('weather.csv')
my_turbine, e126 = initialise_wind_turbines()
calculate_power_output(weather, my_turbine, e126)
plot_or_print(my_turbine, e126)


if __name__ == "__main__":
run_basic_example()


But am unable to compile it successfully. I get the errors as evident from the stack trace below:-



/Users/joyjitchatterjee/anaconda3/envs/windproject1/bin/python /Users/joyjitchatterjee/Desktop/windAnalysis/test.py
Traceback (most recent call last):
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 243, in <module>
run_basic_example()
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 237, in run_basic_example
my_turbine, e126 = initialise_wind_turbines()
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 111, in initialise_wind_turbines
my_turbine = WindTurbine(**myTurbine)
TypeError: __init__() got an unexpected keyword argument 'name'

Process finished with exit code 1


The key thing to mention here is that I have a folder on my desktop (/Users/joyjitchatterjee/Desktop/example) with the weather.csv file. Also, the code I am compiling is stored in the folder (/Users/joyjitchatterjee/Desktop/windAnalysis) with the name test.py. I am not sure why the __init__() dunder method is giving this weird error, and if I need to specify any explicit argument instead of name to run the example code. I am new to using both windpowerlib and Python with packages like these, and any help in this regard would be highly appreciated. Thanks!










share|improve this question




















  • 1





    The vast majority of that code is irrelevant to the issue. Please remove and boil it down to the actual issue.

    – roganjosh
    Jan 1 at 15:33











  • @roganjosh Thanks for the suggestion. I have removed the redundant code and now only 2 methods which are causing the error as per stacktrace are there.

    – Joyjit Chatterjee
    Jan 1 at 15:41














0












0








0








I am trying to refer to the windpowerlib documentation (https://windpowerlib.readthedocs.io/en/stable/getting_started.html#examplereference-label) and using the sample Python Script and Example Weather Data File. I have created a new virtual environment within Anaconda 3 called windproject1, and installed the windpowerlib in that directory via pip.



I execute the example code in PyCharm Community Edition 2018.1 available on the aforesaid link which isn't compiling successfully. I am mentioning the 2 methods which are likely causing the error as per the Stacktrace below:-



def initialise_wind_turbines():
r"""
Initialises two :class:`~.wind_turbine.WindTurbine` objects.

Function shows two ways to initialise a WindTurbine object. You can either
specify your own turbine, as done below for 'myTurbine', or fetch power
and/or power coefficient curve data from data files provided by the
windpowerlib, as done for the 'enerconE126'.
Execute ``windpowerlib.wind_turbine.get_turbine_types()`` or
``windpowerlib.wind_turbine.get_turbine_types(
filename='power_coefficient_curves.csv')`` to get a list of all wind
turbines for which power and power coefficient curves respectively are
provided.

Returns
-------
Tuple (WindTurbine, WindTurbine)

"""

# specification of own wind turbine (Note: power coefficient values and
# nominal power have to be in Watt)
myTurbine = {
'turbine_name': 'myTurbine',
'nominal_power': 3e6, # in W
'hub_height': 105, # in m
'rotor_diameter': 90, # in m
'power_curve': pd.DataFrame(
data={'values': [p * 1000 for p in [
0.0, 26.0, 180.0, 1500.0, 3000.0, 3000.0]], # in W
'wind_speed': [0.0, 3.0, 5.0, 10.0, 15.0, 25.0]}) # in m/s
}
# initialise WindTurbine object
my_turbine = WindTurbine(**myTurbine)

# specification of wind turbine where power curve is provided
# if you want to use the power coefficient curve add
# {'fetch_curve': 'power_coefficient_curve'} to the dictionary
enerconE126 = {
'turbine_name': 'ENERCON E 126 7500', # turbine name as in register
'hub_height': 135, # in m
'rotor_diameter': 127 # in m
}
# initialise WindTurbine object
e126 = WindTurbine(**enerconE126)

return my_turbine, e126



def run_basic_example():
r"""
Run the basic example.

"""
weather = get_weather_data('weather.csv')
my_turbine, e126 = initialise_wind_turbines()
calculate_power_output(weather, my_turbine, e126)
plot_or_print(my_turbine, e126)


if __name__ == "__main__":
run_basic_example()


But am unable to compile it successfully. I get the errors as evident from the stack trace below:-



/Users/joyjitchatterjee/anaconda3/envs/windproject1/bin/python /Users/joyjitchatterjee/Desktop/windAnalysis/test.py
Traceback (most recent call last):
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 243, in <module>
run_basic_example()
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 237, in run_basic_example
my_turbine, e126 = initialise_wind_turbines()
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 111, in initialise_wind_turbines
my_turbine = WindTurbine(**myTurbine)
TypeError: __init__() got an unexpected keyword argument 'name'

Process finished with exit code 1


The key thing to mention here is that I have a folder on my desktop (/Users/joyjitchatterjee/Desktop/example) with the weather.csv file. Also, the code I am compiling is stored in the folder (/Users/joyjitchatterjee/Desktop/windAnalysis) with the name test.py. I am not sure why the __init__() dunder method is giving this weird error, and if I need to specify any explicit argument instead of name to run the example code. I am new to using both windpowerlib and Python with packages like these, and any help in this regard would be highly appreciated. Thanks!










share|improve this question
















I am trying to refer to the windpowerlib documentation (https://windpowerlib.readthedocs.io/en/stable/getting_started.html#examplereference-label) and using the sample Python Script and Example Weather Data File. I have created a new virtual environment within Anaconda 3 called windproject1, and installed the windpowerlib in that directory via pip.



I execute the example code in PyCharm Community Edition 2018.1 available on the aforesaid link which isn't compiling successfully. I am mentioning the 2 methods which are likely causing the error as per the Stacktrace below:-



def initialise_wind_turbines():
r"""
Initialises two :class:`~.wind_turbine.WindTurbine` objects.

Function shows two ways to initialise a WindTurbine object. You can either
specify your own turbine, as done below for 'myTurbine', or fetch power
and/or power coefficient curve data from data files provided by the
windpowerlib, as done for the 'enerconE126'.
Execute ``windpowerlib.wind_turbine.get_turbine_types()`` or
``windpowerlib.wind_turbine.get_turbine_types(
filename='power_coefficient_curves.csv')`` to get a list of all wind
turbines for which power and power coefficient curves respectively are
provided.

Returns
-------
Tuple (WindTurbine, WindTurbine)

"""

# specification of own wind turbine (Note: power coefficient values and
# nominal power have to be in Watt)
myTurbine = {
'turbine_name': 'myTurbine',
'nominal_power': 3e6, # in W
'hub_height': 105, # in m
'rotor_diameter': 90, # in m
'power_curve': pd.DataFrame(
data={'values': [p * 1000 for p in [
0.0, 26.0, 180.0, 1500.0, 3000.0, 3000.0]], # in W
'wind_speed': [0.0, 3.0, 5.0, 10.0, 15.0, 25.0]}) # in m/s
}
# initialise WindTurbine object
my_turbine = WindTurbine(**myTurbine)

# specification of wind turbine where power curve is provided
# if you want to use the power coefficient curve add
# {'fetch_curve': 'power_coefficient_curve'} to the dictionary
enerconE126 = {
'turbine_name': 'ENERCON E 126 7500', # turbine name as in register
'hub_height': 135, # in m
'rotor_diameter': 127 # in m
}
# initialise WindTurbine object
e126 = WindTurbine(**enerconE126)

return my_turbine, e126



def run_basic_example():
r"""
Run the basic example.

"""
weather = get_weather_data('weather.csv')
my_turbine, e126 = initialise_wind_turbines()
calculate_power_output(weather, my_turbine, e126)
plot_or_print(my_turbine, e126)


if __name__ == "__main__":
run_basic_example()


But am unable to compile it successfully. I get the errors as evident from the stack trace below:-



/Users/joyjitchatterjee/anaconda3/envs/windproject1/bin/python /Users/joyjitchatterjee/Desktop/windAnalysis/test.py
Traceback (most recent call last):
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 243, in <module>
run_basic_example()
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 237, in run_basic_example
my_turbine, e126 = initialise_wind_turbines()
File "/Users/joyjitchatterjee/Desktop/windAnalysis/test.py", line 111, in initialise_wind_turbines
my_turbine = WindTurbine(**myTurbine)
TypeError: __init__() got an unexpected keyword argument 'name'

Process finished with exit code 1


The key thing to mention here is that I have a folder on my desktop (/Users/joyjitchatterjee/Desktop/example) with the weather.csv file. Also, the code I am compiling is stored in the folder (/Users/joyjitchatterjee/Desktop/windAnalysis) with the name test.py. I am not sure why the __init__() dunder method is giving this weird error, and if I need to specify any explicit argument instead of name to run the example code. I am new to using both windpowerlib and Python with packages like these, and any help in this regard would be highly appreciated. Thanks!







python pycharm anaconda






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 at 15:40







Joyjit Chatterjee

















asked Jan 1 at 15:30









Joyjit ChatterjeeJoyjit Chatterjee

5613




5613








  • 1





    The vast majority of that code is irrelevant to the issue. Please remove and boil it down to the actual issue.

    – roganjosh
    Jan 1 at 15:33











  • @roganjosh Thanks for the suggestion. I have removed the redundant code and now only 2 methods which are causing the error as per stacktrace are there.

    – Joyjit Chatterjee
    Jan 1 at 15:41














  • 1





    The vast majority of that code is irrelevant to the issue. Please remove and boil it down to the actual issue.

    – roganjosh
    Jan 1 at 15:33











  • @roganjosh Thanks for the suggestion. I have removed the redundant code and now only 2 methods which are causing the error as per stacktrace are there.

    – Joyjit Chatterjee
    Jan 1 at 15:41








1




1





The vast majority of that code is irrelevant to the issue. Please remove and boil it down to the actual issue.

– roganjosh
Jan 1 at 15:33





The vast majority of that code is irrelevant to the issue. Please remove and boil it down to the actual issue.

– roganjosh
Jan 1 at 15:33













@roganjosh Thanks for the suggestion. I have removed the redundant code and now only 2 methods which are causing the error as per stacktrace are there.

– Joyjit Chatterjee
Jan 1 at 15:41





@roganjosh Thanks for the suggestion. I have removed the redundant code and now only 2 methods which are causing the error as per stacktrace are there.

– Joyjit Chatterjee
Jan 1 at 15:41












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53996672%2funable-to-use-windpowerlib-in-anaconda-environment-with-pycharm%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53996672%2funable-to-use-windpowerlib-in-anaconda-environment-with-pycharm%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Mossoró

Error while reading .h5 file using the rhdf5 package in R

Pushsharp Apns notification error: 'InvalidToken'