-
Notifications
You must be signed in to change notification settings - Fork 61
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: deprecation decorators for transition to functional API #406
Conversation
tl;dr – I like it.
|
I am going to revise this and, on top of the points listed above, build the new implementation on top of |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #406 +/- ##
=======================================
+ Coverage 97.4% 97.9% +0.5%
=======================================
Files 26 37 +11
Lines 4328 5444 +1116
=======================================
+ Hits 4214 5328 +1114
- Misses 114 116 +2
|
I have updated this to reflect the current state of things. I'd like to merge it so we can use it as some classes are to be removed and adding a decorator would be nice to do now while we remember that. |
This is a proof-of-concept of the switch from the class-based API we have now to the functional API discussed in #340. It illustrates before-after as well as the transition period.
A couple of things to discuss:
spatial_weights -> w
) and potentially even remove some stuff from momepy and move it elsewhere, like all our fancy ways of building lags (e.g. AverageCharacter).unique_id
column, that has been used to index the weights. I would like to get rid of that and depend on the actual index of gdf instead, or at least have this controlled by a keyword. In most cases, passingunique_id
is completely unnecessary. That all depends on the correct behaviour of libpysal in the first place, though (xref API: Change the handling of IDs in from_dataframe constructors libpysal#477). As a result, a lot would break but the final API in 1.0 will be much cleaner and easier to use.@jGaboardi thoughts? It is a lot of breakage but if it happens all at once with a proper migration guide, it may not hurt that much. And since we're following semver here, it still acceptable.