Add module for data handling and check integrity of turbine data#101
Conversation
It might be a good idea to copy some other data-functions to this module.
…ind-python/windpowerlib into features/new_data_structure_with_check
…es/new_data_structure_with_check
|
There are still some tests missing with a wrong dataset. At the moment the test will log suspicious data sets but will not remove them. It is possible to add additional checks. @birgits, @SabineHaas Please check whether you agree with the basic approach. |
|
This pull request introduces 1 alert when merging d32aca5 into 1273dea - view on LGTM.com new alerts:
|
…ind-python/windpowerlib into features/new_data_structure_with_check
…ind-python/windpowerlib into features/new_data_structure_with_check
SabineHaas
left a comment
There was a problem hiding this comment.
Thank you @uvchik and excuse my late review!
I already give my approval although you should check my suggestions and comments.
I would also appreciate if you could add some more comments and docstrings - at least a one line explanation for each new function. :)
|
|
||
| def get_turbine_types(turbine_library="local", print_out=True, filter_=True): | ||
| r""" | ||
| Get all provided wind turbine types provided. |
There was a problem hiding this comment.
| Get all provided wind turbine types provided. | |
| Get all provided wind turbine types. |
| "{0}: No cp-curve but has_cp_curve=True.".format(wt_type) | ||
| ) | ||
| if wt.power_curve is not None: | ||
| if len(wt.power_curve) < min_pc_length: |
There was a problem hiding this comment.
Should we add a minimum length for cp curves, too?
|
A new thought about this issue. We could store the update of the turbine data at a new place. This will have some advantages:
|
Now default data is used instead of back files. Please check again.
SabineHaas
left a comment
There was a problem hiding this comment.
Looks good to me @uvchik !
| filename = os.path.join(os.path.dirname(__file__), "oedb", "{0}.csv") | ||
|
|
||
| # get all power (coefficient) curves and save to file | ||
| # for curve_type in ['power_curve', 'power_coefficient_curve']: |
There was a problem hiding this comment.
| # for curve_type in ['power_curve', 'power_coefficient_curve']: |
UPDATE:
3.
get_turbine_types()will not silently import new database from oedb. In the past the local data has been overwritten by this function.