-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: move safe_sort to algos to avoid private/circular dependencies #29384
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
Conversation
rather than adding to algos i would put in a separate module pandas/corr/algos/sorting.py, safe_sort.py, algos.py |
I think we're going to get there before long, yah. There are a few parts of algorithms.py that are inextricably intertwined with Series, but a bunch of it can be made low-dependency with a few tweaks. One of those tweaks is going to be inside safe_sort, which still has a runtime import of Index which I plan to address in the next step. After that is when I was thinking of making core/algos/ a directory |
right but rather than moving it twice wouldn’t make sense to move to safe_sort.py now? |
either way i guess. making a new directory and moving a bunch of stuff into it entails updating a lot of other imports |
since this is a moving PR, I think doing it here is better (e.g. just move this for now to pandas/core/algos/safe_sort.py), then changing other things can be a follow on |
last effort to push back before i go along with this: |
ok fine..... but would love the refactor - ok on doing as followons |
safe_sort uses private functions from core.algorithms and is runtime-imported into core.algorithms. It also doesn't use anything else defined in core.sorting. This move cleans up the dependency structure, in particular is a step towards getting #29133 working.