-
Notifications
You must be signed in to change notification settings - Fork 186
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
add function for reverse links direction #368
Conversation
Thanks for contributing this function! Can you provide simple API documentation and a test? I can push an update that will resolve the current test failure. |
wntr/morph/link.py
Outdated
return wn2 | ||
|
||
|
||
def reverse_link(wn: wntr.network.WaterNetworkModel, link_name: str) -> wntr.network.WaterNetworkModel: |
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.
For type comments, please just use the name of the class. In this case WaterNetworkModel
. This goes for the function signature and the docstring.
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 recommend implementing the keyword argument return_copy
as is done in wntr.morph.link._split_or_break_pipe
. This should default to True to follow the rest of WNTR's API.
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.
Hi @GalPerelman. I looked over your changes and left a few small comments to address. Once those are taken care of, we'll be ready to pull in your contribution.
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.
@GalPerelman Are you able to update your PR with these changes?
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.
@kbonney
Sorry for the late response, for some reason I missed your comments
Yes, I will update the PR soon
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.
@GalPerelman, I think I missed the "submit review" button so the notifications only went through recently. Thanks!
@kbonney |
Thanks for resolving those issues. |
This PR adds a function that can reverse links direction
The function preserves the link's vertices