Closed uvchik closed 5 years ago
I could add more tests if you like the general idea.
Thank you very much @uvchik for your suggestions! I think it is alot easier this way. I do have some minor comments/questions:
Thank you also from my side @uvchik! I have a minor comment and answer to @birgits:
I would definitely include a check - I think a warning might be enough and advantageous as it gives the possibility of setting a curve later.
If we leave it like that, we should write a sentence somewhere in the docu/docstrings to make this clear as this is important if users want to normalize the feed-in time series - for example oemof has problems with values > 1 in a certain modus.
If it is a list we could give a warning that the rotor diameter could not be set as there are various possibilities, give the possibilities and suggest to set the rotor diameter manually.
@birgits, @SabineHaas Thank you for your feedback.
* We usually named parameters, variables, etc.. with full names. I'd suggest to use for example 'power_coefficient_curve' instead of 'pcc' in the code for readability and consistency but I know that this is a matter of taste.
Done with 5634d53 .
There are some untested lines in the wind_farm
module. Everything else looks pretty okay.
I rebased this PR to the dev branch. It contains all commits of #58, so if we merge this one we can just close the other PR.
This PR is already very extensive. We should merge it soon if we basically agree with the changes and outsource all pending issues into separate ones. At the moment it becomes very complex and confusing.
There are a lot of tests packed together in one method/function. Testing is easier if there is just one test in one method/function because at the moment you do not know directly which test has failed if such a packed test fails. Most test do have a comment line this comment line could be the docstring, so I think it does not take more effort to write little tests.
I separate some but not all tests. We can do that step by step because it is not urgent.
You could check 7738df6 or 5cc0685 to see what I mean.
Thank you @uvchik for your great effort, it looks great! The only thing I'd like to discuss before merging is point 2 in my comments below:
2) I like explicit more than implicit. So if you want to deduce the nominal_power of the power curve you can do the following:
my_wt = wind_turbine.WindTurbine(**some_data_without_nominal_power)
my_wt.deduce_nominal_power_from_power_curve()
print(my_wt.nominal_power)
I only partly agree. I think that getting the nominal power from the power curve is not that explicit or far-fetched. Furthermore, it is more convenient to only have to provide a power curve and have the nominal power automatically deduced from it in case it is needed for something instead of getting an error message. I talked to @SabineHaas about it and she suggested giving an info in case the nominal power is automatically deduced from the power curve. What do you think about that suggestion?
In my opinion the
WindTurbine
class was a little bit to complicated even though I like the general idea.power_curves.csv
,power_coefficient_curves.csv
andturbine_data.csv
. Furthermore these files have to have the same structure as the oedb files. We could make it possible to change the filename and for me the same name signifies the same structure. If you want to use your own files with your own format you can read them and pass the results directly to theTurbineClass
.nominal_power
this data will not be retrieved from a file.