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
SortedContainers 2.0 broke compatibility with no warning #92
Comments
same problem, big surprise Update: found doc in HISTORY.rst |
Same problem. I and many users that I support depend on sortedcontainers. I'm happy to see things modernize but would appreciate a deprecation cycle so that downstream projects can respond sensibly. All of my users that are now installing things are getting failures without warning. I would strongly appreciate the rapid removal of the offending package from PyPI and the upload of a new one that raised deprecation warnings. |
Hello, all. Just woke up. Will look at this immediately. Sorry for the surprise breaks. I have a busy day/week so the easiest current solution that I can see is to remove the V2 uploads from PyPI. Is there any way to leave them there and make v1.5.10 preferred? |
I've seen people host pre-releases on PyPI so there must be a way to have newer-but-not-default packages around. |
Is it just
|
@LipillaiDave Can you be more specific? The SortedKeysView inherits collections.KeysView which does implement a set-like interface. Also breaking changes are documented in the release history at http://www.grantjenks.com/docs/sortedcontainers/history.html Also upgrade guide at http://www.grantjenks.com/docs/sortedcontainers/introduction.html#migrating |
Yes, In my ideal world Of course, if you think that |
I get what you're saying. It sounds nice. But it will take me a fair amount of time to learn how to do that. I can probably get there by the end of next week. For today, let's figure out the best way forward.
I numbered things above just for reference. Don't think of them sequentially. |
|
Hi Grant, Sorry if I seemed crabby. I'm extremely grateful for SortedCollections. It was just past 1AM and I was woke up from sleep troubleshooting remote customers. I'm not opposed to it changing moving forward, although I'd like to present a case for keeping iloc. Is there any real reason to remove it? SortedContainers is a feature- and performance-plus package. It makes sense to emulate Python3 style, sure, but why remove what is working well and fast for those who use it for the right reasons? In regards to your question about intersections, this line of code was getting the following error:
|
@LipillaiDave Thank you for the kind words. That was an unintended regression. Sorry! I will look into it today. @mrocklin -- I can add I am teaching class all day so I may be less responsive then I would like. I will update at 1pm today (lunch) and see what I can get done this morning. I appreciate you all as users and your feedback! |
Thanks for your responsiveness during a pressured time.
If you're able to take down the errant packages that would probably reduce
time pressure significantly. People are downloading these now and getting
faulty installs.
…On Mon, May 21, 2018 at 11:31 AM, Grant Jenks ***@***.***> wrote:
@LipillaiDave <https://github.com/LipillaiDave> Thank you for the kind
words. That was an unintended regression. Sorry! I will look into it today.
@mrocklin <https://github.com/mrocklin> -- I can add .iloc back with no
performance regression. I will try to do so this morning.
I am teaching class all day so I may be less responsive then I would like.
I will update at 1pm today (lunch) and see what I can get done this morning.
I appreciate you all as users and your feedback!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#92 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASszM_Q1geZ2C0c6SX5-j6OZ0FIbV03ks5t0t3ZgaJpZM4UGeC7>
.
|
@LipillaiDave Looks like you're using Python 2 and executing https://github.com/grantjenks/python-sortedcontainers/blob/v1/sortedcontainers/sorteddict.py#L224 from v1. In v1 on Python 2, the
I think you can rewrite it as:
Now, the
Now I'm just guessing but I think you might've implemented something like:
That is indeed slow as iterating the So I think the necessary changes are:
Would that fix your issues? |
I think (2, above) is already done. Iterating a KeysView iterates the mapping directly which iterates the sorted list which should be extremely fast. For reference: https://github.com/python/cpython/blob/3.6/Lib/_collections_abc.py#L719 Could you say more about, "and this uses tons of memory and time," in your original report? |
Should we plan to deprecate |
@mrocklin Yes, consider |
Fixes deployed in v2.0.3 on PyPI. |
Hello,
You may not view this as a bug, but it was a big surprise for me! SortedDict() .keys() used to return sets that could do .intersect() operations. It must now be converted from SortedKeysView (or something?) to a set() and this uses tons of memory and time. The iloc method was also removed. I only got that far before I realized the build I was troubleshooting had a newer version than dev and was broken because of it. Please put a "breaking changes" section into the documentation when making these sorts of things! Or better yet, don't go fixing what isn't broken and also remove functionality :-D
The text was updated successfully, but these errors were encountered: