Skip to content

Calculating turbine power output defective on my_turbine #16

@arnonuem

Description

@arnonuem

This is the error provided by the notebook

KeyError                                  Traceback (most recent call last)
c:\python37\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
   3077             try:
-> 3078                 return self._engine.get_loc(key)
   3079             except KeyError:

pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'values'

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
<ipython-input-31-9297154bc349> in <module>
      2 # initialise ModelChain with default parameters and use run_model
      3 # method to calculate power output
----> 4 mc_my_turbine = ModelChain(my_turbine).run_model(weather)
      5 # write power output timeseries to WindTurbine object
      6 my_turbine.power_output = mc_my_turbine.power_output

c:\python37\lib\site-packages\windpowerlib\modelchain.py in run_model(self, weather_df)
    404                        else self.density_hub(weather_df))
    405         self.power_output = self.turbine_power_output(wind_speed_hub,
--> 406                                                       density_hub)
    407         return self

c:\python37\lib\site-packages\windpowerlib\modelchain.py in turbine_power_output(self, wind_speed_hub, density_hub)
    335                         wind_speed_hub,
    336                         self.wind_turbine.power_curve['wind_speed'],
--> 337                         self.wind_turbine.power_curve['values'],
    338                         density_hub, self.density_correction))
    339         elif self.power_output_model == 'power_coefficient_curve':

c:\python37\lib\site-packages\pandas\core\frame.py in __getitem__(self, key)
   2686             return self._getitem_multilevel(key)
   2687         else:
-> 2688             return self._getitem_column(key)
   2689 
   2690     def _getitem_column(self, key):

c:\python37\lib\site-packages\pandas\core\frame.py in _getitem_column(self, key)
   2693         # get column
   2694         if self.columns.is_unique:
-> 2695             return self._get_item_cache(key)
   2696 
   2697         # duplicate columns & possible reduce dimensionality

c:\python37\lib\site-packages\pandas\core\generic.py in _get_item_cache(self, item)
   2487         res = cache.get(item)
   2488         if res is None:
-> 2489             values = self._data.get(item)
   2490             res = self._box_item_values(item, values)
   2491             cache[item] = res

c:\python37\lib\site-packages\pandas\core\internals.py in get(self, item, fastpath)
   4113 
   4114             if not isna(item):
-> 4115                 loc = self.items.get_loc(item)
   4116             else:
   4117                 indexer = np.arange(len(self.items))[isna(self.items)]

c:\python37\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
   3078                 return self._engine.get_loc(key)
   3079             except KeyError:
-> 3080                 return self._engine.get_loc(self._maybe_cast_indexer(key))
   3081 
   3082         indexer = self.get_indexer([key], method=method, tolerance=tolerance)

pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'values'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions