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

Functional count #585

Closed
wants to merge 4 commits into from
Closed

Functional count #585

wants to merge 4 commits into from

Conversation

u3ks
Copy link
Collaborator

@u3ks u3ks commented May 20, 2024

Functional implmentation of mm.Count

this function has the same logic as area_ratio, but the weight is inferred from the geometry type.
Potentially, it could be left to the user to implement it with a call to describe_reached (or two if the result should be weighted). (similarly to arearatio)

Copy link

codecov bot commented May 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.9%. Comparing base (4037c70) to head (6810680).
Report is 25 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #585     +/-   ##
=======================================
+ Coverage   97.4%   97.9%   +0.5%     
=======================================
  Files         26      37     +11     
  Lines       4328    5434   +1106     
=======================================
+ Hits        4214    5318   +1104     
- Misses       114     116      +2     
Files Coverage Δ
momepy/functional/_intensity.py 100.0% <100.0%> (ø)
momepy/functional/tests/test_intensity.py 100.0% <100.0%> (ø)

def count(
left: GeoDataFrame,
right: GeoDataFrame,
right_group_key: Series | np.ndarray,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
right_group_key: Series | np.ndarray,
aggregation_key: Series | np.ndarray,

as per #583


def count(
left: GeoDataFrame,
right: GeoDataFrame,
Copy link
Member

Choose a reason for hiding this comment

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

Do we actually need right at all? Doesn't the grouping have all the info we need?

@u3ks u3ks requested a review from martinfleis June 10, 2024 08:36
@u3ks u3ks closed this Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants