-
Notifications
You must be signed in to change notification settings - Fork 74
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
Don't sort individuals by default #1789
Conversation
This is tricky - let's have a chat about it tomorrow, see if we can figure out a clean path forward? |
97911c2
to
7a2e265
Compare
Codecov Report
@@ Coverage Diff @@
## main #1789 +/- ##
==========================================
+ Coverage 93.41% 93.43% +0.01%
==========================================
Files 27 27
Lines 24756 24716 -40
Branches 1095 1095
==========================================
- Hits 23127 23093 -34
+ Misses 1594 1588 -6
Partials 35 35
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
9f01305
to
1fbb102
Compare
@jeromekelleher I think this is ready, although do we need to check integrity before we sort? |
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.
LGTM, some minor tweaks.
Nice minimally destructive approach!
c/tskit/tables.h
Outdated
@return Return 0 on success or a negative value on failure. | ||
*/ | ||
int tsk_table_collection_sort( | ||
tsk_table_collection_t *self, const tsk_bookmark_t *start, tsk_flags_t options); | ||
|
||
/** | ||
@brief Sorts the indivdual table in this collection. |
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.
typo, indivdual
python/tskit/tables.py
Outdated
@@ -3165,6 +3164,15 @@ def sort(self, edge_start=0): | |||
self._ll_tables.sort(edge_start) | |||
# TODO add provenance | |||
|
|||
def sort_individuals(self, edge_start=0): |
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.
Remove edge_start
param
c/tskit/tables.c
Outdated
@@ -6379,7 +6380,7 @@ tsk_table_sorter_run(tsk_table_sorter_t *self, const tsk_bookmark_t *start) | |||
goto out; | |||
} | |||
} | |||
if (!skip_individuals) { | |||
if (!skip_individuals && self->sort_individuals) { |
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.
Comparisons to NULL are usually explicit, i.e., && (self->sort_individuals != NULL)
Reading this I assumed that self->sort_individuals
is a boolean
We should update the CHANGELOGs in case we forget. |
4th times the charm.... Did you see the question about checking integrity before sort, I think as it stands you could make python segfault with this. |
I haven't thought about it, but the answer is in the question if this is true! |
bc0bc4f
to
c5802b4
Compare
c5802b4
to
3a88790
Compare
@jerome all fixed up and changlog added, assuming CI is now happy this is good to go. |
Part of #1774
I started ripping loads of code out, then realised that maybe this is a less destructive way to do this. (Commented out code will return when the individual sort method uses it.)
WIP for feedback, next is removing the requirement from checks