-
Notifications
You must be signed in to change notification settings - Fork 58
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
ENH: improved node consolidation functions #377
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #377 +/- ##
=======================================
- Coverage 97.5% 97.4% -0.2%
=======================================
Files 26 26
Lines 4189 4317 +128
=======================================
+ Hits 4086 4203 +117
- Misses 103 114 +11
|
momepy/preprocessing.py
Outdated
# Create a buffer around the new origin: | ||
new_origin_buffer = new_origin.buffer(buff) | ||
# Use shapely.ops.split to break the edge where it intersects the buffer: | ||
geometry_split_by_buffer_list = list(split(geometry, new_origin_buffer)) |
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.
have you tried using difference
instead? It may be more efficient that split
+ linemerge
(but may not and may cause more trouble than good).
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.
@gsagostini have you had a chance to work on tests?
@gsagostini Have you closed it intentionally? |
I discarded edits while trying to fetch upstream in order to bring my fork up to date. Will open the PR again soon with the new commits. |
@martinfleis @jGaboardi I reopened it with the tests and updated commits. |
@gsagostini Did you run |
@jGaboardi I had ran black only in the momepy directory but now it should have been fine for the tests too |
You will need to add |
Tests are still failing for the |
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.
Thanks! This is a great PR! Left just a couple of minor comments.
@jGaboardi @martinfleis thanks! yes those are all commits I wanted to do in the |
@gsagostini I synced this with main. You will need to pull the changes. flake8 is complaining about long lines in docstrings, you'll need to fix that. CodeFactor can be ignored. |
@martinfleis sounds good will do. Is flake8 something I can install and run like black? |
Yes -> https://flake8.pycqa.org/en/latest/. We also use You propably must first install pre-commit:
From the root of the repository, you should then install the pre-commit included in momepy:
Then black and flake8 and sort will be run automatically each time you commit changes. You can skip these checks with |
Great! I added the notebook too. Let me know if there is more to be said on the user guide, and I will take a look :) EDIT: Seems like there is a notebook error from building the docs. Let me know if it's easier to create a separate PR for the user guide. |
@gsagostini It would be great if this can be finished soon, so we can release 0.6. Any updates from your side? Do you have a bit of time or shall we try to resolve remaining issues? |
I have revived this. Resolved conflicts, fixed shapely 2.0 compatibility, fixed some minor lint issues. I did not do thorough review of the code hoping that my former self in 2022 did :D. I believe this can be merged now. All this functionality will undergo some testing and momepy 1.0 may or may not include it, depending on the results. |
Dangerous assumption 🤣 |
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.
All suggestions are minor doc adjustments.
Co-authored-by: James Gaboardi <jgaboardi@gmail.com>
@martinfleis shall we squash & merge? |
@gsagostini Thanks for all the work that went into this! |
As Martin said, congrats @gsagostini !!! 🎉 |
Function for consolidating intersections on street networks based on graph-distances along with edge reconstruction. Tests to come.