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
Warn about deprecation of sindex.intersection objects parameter #1440
Conversation
Can we add tests that it properly raised a warning? Wrapping this line in this would do the job. with pytest.warns(FutureWarning, match="A future version of GeoPandas will deprecate"): geopandas/geopandas/tests/test_sindex.py Line 108 in 3cba9b7
|
@martinfleis are we going to make a dev branch to work on stuff that isn't intended for 0.8.0? |
geopandas/sindex.py
Outdated
""" | ||
if objects: | ||
warn( | ||
"A future version of GeoPandas will deprecate the `objects`" |
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.
How about
'objects' is deprecated and will be replaced by a different interface to labels in the sindex geometries in an upcoming release.
I don't know that the "If you use this option" is necessary here; this doesn't get added to other deprecation notices.
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.
My thoughts were that we do not really know who uses this interface and why. I thought it would be good to get some issue reports that might help shape what that future implementation of loc/label
based indexing will look like, or if it is needed at all.
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.
I think we can just say it will be removed in the future. But it might be good to indicate what to do instead (how to achieve the same behaviour without using the keyword), so it's clear for users how to replace their usage of it.
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.
So something like:
`objects` is deprecated and will be removed in a future version. Instead, use `iloc` to index your GeoSeries/GeoDataFrame using integer indexes returned by `intersection`.
?
We didn't do that yet in the past (the main releases are cut from master, only for bug fix releases, we made separate branches). I would say: if you want to work on something that is only for after 0.8.0, you can already start on it / open a PR targetting master, but it can only be merged after 0.8 is released. If it turns out to be a problem in practice, we can always reconsider our branching strategy. |
geopandas/sindex.py
Outdated
""" | ||
if objects: | ||
warn( | ||
"A future version of GeoPandas will deprecate the `objects`" |
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.
I think we can just say it will be removed in the future. But it might be good to indicate what to do instead (how to achieve the same behaviour without using the keyword), so it's clear for users how to replace their usage of it.
I pushed the changes to the warning/docs text |
Pinging you on this one as well @martinfleis, let me know if there's more discussion needed or anything I can do on my end. Thanks! |
Thank you @adriangb! |
As discussed in #1439, I think it would be best to deprecate the
objects
parameter. This makes a warning for using it. Hopefully this will be a good first step in that direction.