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

API: deprecate legacy API in favour of Graph-based functional implementation #619

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

martinfleis
Copy link
Member

Closes #612

Adds decorators and custom warnings when decorator does not fit to remaining classes.

The only missing is NeighboringStreetOrientationDeviation. @u3ks what are we doing about that one?

@u3ks also, can you review this if I'm pointing to correct things?

@martinfleis martinfleis added this to the 0.8.0 milestone Jun 19, 2024
@martinfleis martinfleis self-assigned this Jun 19, 2024
@@ -18,67 +18,30 @@ def setup_method(self):
self.df_buildings["height"] = np.linspace(10.0, 30.0, 144)

def test_Area(self):
with pytest.warns(
Copy link
Member Author

Choose a reason for hiding this comment

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

Given we test the decorators and can silence these warnings, I am removing explicit checks from individual classes.

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 96.62921% with 3 lines in your changes missing coverage. Please review.

Project coverage is 98.0%. Comparing base (4037c70) to head (b0bc871).
Report is 55 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #619     +/-   ##
=======================================
+ Coverage   97.4%   98.0%   +0.6%     
=======================================
  Files         26      38     +12     
  Lines       4328    6158   +1830     
=======================================
+ Hits        4214    6033   +1819     
- Misses       114     125     +11     
Files Coverage Δ
momepy/dimension.py 98.8% <100.0%> (+0.1%) ⬆️
momepy/diversity.py 98.4% <100.0%> (+0.1%) ⬆️
momepy/intensity.py 99.5% <100.0%> (+<0.1%) ⬆️
momepy/shape.py 91.8% <100.0%> (+0.3%) ⬆️
momepy/tests/test_dimension.py 100.0% <100.0%> (ø)
momepy/tests/test_intensity.py 100.0% <100.0%> (ø)
momepy/tests/test_utils.py 99.4% <100.0%> (+0.1%) ⬆️
momepy/distribution.py 97.2% <92.3%> (-0.2%) ⬇️
momepy/elements.py 96.7% <85.7%> (-0.2%) ⬇️
momepy/weights.py 98.4% <83.3%> (-1.6%) ⬇️

@u3ks
Copy link
Collaborator

u3ks commented Jun 20, 2024

NeighboringStreetOrientationDeviation is missing.
I think the same functionality can be reimplemented using graph and then a call to Graph.apply.
But I dont think we can leave it to the user, since we got to define a custom apply function to take absolute difference, then mean.

@martinfleis martinfleis changed the title API: deprecation notices on legacy api API: deprecate legacy API in favour of Graph-based functional implementation Jun 20, 2024
@martinfleis
Copy link
Member Author

NeighboringStreetOrientationDeviation is missing.

Can you look into that one?

momepy/intensity.py Outdated Show resolved Hide resolved
momepy/intensity.py Outdated Show resolved Hide resolved
@martinfleis martinfleis merged commit dbd8d5b into pysal:main Jun 20, 2024
15 checks passed
@martinfleis martinfleis deleted the deprecations branch June 20, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: deprecate legacy API
3 participants