Skip to content
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: street_alignment and get_nearest_street #566

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

martinfleis
Copy link
Member

I love how streamlined these things are now compared to the original :).

@martinfleis martinfleis added the enhancement New feature or request label Apr 15, 2024
@martinfleis martinfleis added this to the 0.8.0 milestone Apr 15, 2024
@martinfleis martinfleis self-assigned this Apr 15, 2024
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.7%. Comparing base (4037c70) to head (02e9b54).
Report is 11 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #566     +/-   ##
=======================================
+ Coverage   97.4%   97.7%   +0.3%     
=======================================
  Files         26      32      +6     
  Lines       4328    4985    +657     
=======================================
+ Hits        4214    4869    +655     
- Misses       114     116      +2     
Files Coverage Δ
momepy/functional/_distribution.py 100.0% <100.0%> (ø)
momepy/functional/_elements.py 96.8% <100.0%> (ø)
momepy/functional/tests/test_distribution.py 100.0% <100.0%> (ø)
momepy/functional/tests/test_elements.py 100.0% <100.0%> (ø)

momepy/functional/_distribution.py Show resolved Hide resolved
momepy/functional/_distribution.py Outdated Show resolved Hide resolved
momepy/functional/_distribution.py Outdated Show resolved Hide resolved


def get_nearest_street(
buildings: gpd.GeoSeries | gpd.GeoDataFrame,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there is specific reasoning to using both pd and Series above, and using gpd.GeoSeries here? Should we also do from gpd import GeoSeries to conform? Or vice-versa?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular reason. My thought was that people will be familiar with Series but may not be with GeoSeries, so I wanted to indicate where it comes from. Do you have any preference here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My personal preference is "always explicit" so if I'd had my way it would be non-aliased & full usage: e.g.:

import pandas
...
pandas.Series

However, I know that my preference is not norm. If I had to choose one of the two methods already being used here, I'd probably go with non-aliased classes (e.g. from gpd import GeoSeries) for the type hinting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also know that you like linting rules, so have one for you - https://docs.astral.sh/ruff/rules/unconventional-import-alias/

martinfleis and others added 2 commits April 15, 2024 20:36
Co-authored-by: James Gaboardi <jgaboardi@gmail.com>
@martinfleis
Copy link
Member Author

I'll do the typing consistency as a follow-up across the codebase.

@martinfleis martinfleis merged commit 44e3ceb into pysal:main Apr 15, 2024
11 checks passed
@martinfleis martinfleis deleted the street-alignment branch April 15, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants