-
Notifications
You must be signed in to change notification settings - Fork 7
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
iter_morphology output is unsorted #59
Comments
Yes, sorting is probably the best. |
As an alternative, why it should guarantee any order? If user needs order, he can sort on his side. What do you think? |
I agree with this, yes. |
It was breaking a test randomly which was hardcoding the expected order of morphs in neuror here BlueBrain/NeuroR#62. |
I'd say sort it's output where it is needed (in those failing tests). |
What is the good reason for going through the pain of updating all tests to make sure they won't randomly fail in a future PR rather than a small change here? |
By sorting, you are complexifying the functionality and decreasing the perf. You also need to update the docstring to explicit the expected sorted ordering. It is better to keep functions simple with a minimal functionality. |
so the simplest is to not use that function in neuror test, and just use a custom sorted one
|
The change is O(1) to O(N log N). It is massive. Like really massive. Try doing
I must be using it in 20 locations lol, I wouldn't call it useless ! And I have no need of the sorting.
Have you tried using |
Ah ok, indeed, it's massive, I didn't realize. The issue is not comparing sorted dict, it is that the dict constructed to compare result has wrong pairs of key/values if the keys are shuffled randomly. I'll put an issue in neuror to fix all the tests then. |
I guess we can close this issue? |
This function is sometimes non-reproducible in the ordering of morphs:
https://github.com/BlueBrain/morph-tool/blob/master/morph_tool/utils.py#L16
I think because of pathlib, maybe we can add an sorted() somewhere to ensure it is?
@asanin-epfl @adrien-berchet , what do you think?
The text was updated successfully, but these errors were encountered: