-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix turbine #92
Fix turbine #92
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a good idea to filter wrong parameter combinations. Thank you.
Just two small comments.
if self.rotor_diameter: | ||
if self.hub_height <= 0.5*self.rotor_diameter: | ||
msg = "1/2*rotor_diameter cannot be higher than hub_height" | ||
raise ValueError(msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a native speaker but as I know it in a mathematical sense one value is GREATER than another not HIGHER.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
'path': self.source | ||
} | ||
with pytest.raises(ValueError): | ||
WindTurbine(**char) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use the match attribute to make sure the right ValueError is raised.
with pytest.raises(ValueError, match=regex)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented. However, I had a problem with match when there was an asterisk symbol in the string so I modified the error message slightly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that can be merged. If there are no objections I will merge tomorrow.
Fixes #89 .