-
Notifications
You must be signed in to change notification settings - Fork 78
Rename int and load flags to common namespace #2224
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
3d579e2 to
a86532c
Compare
jeromekelleher
left a comment
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.
I think we probably need to think through the flags semantics for table collection init/table init a little more clearly, but this is a good step.
|
Ha, I've actually created a collision here as all |
a86532c to
496d6b7
Compare
|
@jeromekelleher After playing around I've added to the PR to try and sort out the load/init flags, giving them a shared name space. It actually revealed an error where the tests were only working due to a collision. |
Codecov Report
@@ Coverage Diff @@
## main #2224 +/- ##
=======================================
Coverage 93.30% 93.30%
=======================================
Files 27 27
Lines 26003 26003
Branches 1165 1165
=======================================
Hits 24262 24262
Misses 1711 1711
Partials 30 30
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
jeromekelleher
left a comment
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'm not sure this @benjeffery - what do you think of my suggestion of thinking of the flags to init/load as declaring properties of the thing (table,table collection) and namespace that way?
c/tskit/tables.h
Outdated
| #define TSK_LOAD_INIT_SKIP_TABLES (1 << 1) | ||
| #define TSK_LOAD_INIT_SKIP_REFERENCE_SEQUENCE (1 << 2) | ||
| #define TSK_LOAD_INIT_NO_EDGE_METADATA (1 << 3) | ||
| #define TSK_LOAD_INIT_BUILD_INDEXES (1 << 4) |
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.
This one is different, in that it's only ever passed to tsk_treeseq_init(), right?
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.
Could call TSK_TS_INIT_BUILD_INDEXES
c/tskit/tables.h
Outdated
| #define TSK_BUILD_INDEXES (1 << 0) | ||
| /* Flags for table collection load or init | ||
| * As flags are passed though from load to init they share a namespace */ | ||
| #define TSK_LOAD_INIT_NO_METADATA (1 << 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.
LOAD_INIT seems a bit weird. Aren't these properties of the table collection/tables, which we're specifying at init time? So we could say something like
// This table has no metadata
TSK_TABLE_NO_METADATA (1 << 0)
// This table collection will have no reference sequence/tables/edge metadata
TSK_TC_NO_REFERENCE_SEQUENCE(1 << 0)
TSK_TC_NO_TABLES(1 << 1)
TSK_TC_NO_EDGE_METADATA (1 << 2)
Yeah, will give that a try. Has to be better than this! |
4c22aab to
26b9039
Compare
|
@jeromekelleher I think this makes more sense, have the shared namespace as a concept, but not all the same name. |
c/tskit/tables.h
Outdated
| #define TSK_TABLE_NO_METADATA (1 << 1) | ||
| #define TSK_TC_SKIP_REFERENCE_SEQUENCE (1 << 2) | ||
| #define TSK_TC_NO_EDGE_METADATA (1 << 3) | ||
| #define TSK_TS_INIT_BUILD_INDEXES (1 << 4) |
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.
Doesn't TSK_TS_INIT_BUILD_INDEXES belong in trees.h though, and live in a separate namespace? I don't think it interacts with the TableCollection of Table inits at all.
Ah, but SKIP_TABLES and SKIP_REFSEQ can also be passed to tsk_treeseq_load, right? So namespacing these as LOAD makes sense, maybe?
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.
Yes, this is the issue - all flags that get passed to tsk_treeseq_load get passed to tsk_table_collection_load and then all passed on again to tsk_table_collection_init or tsk_table_collection_loadf_inited. So they all need to be in this block.
You're right though TSK_TS_INIT_BUILD_INDEXES is unrelated - got confused with tsk_tc_init. Will move that.
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.
Will change the two "skips" to "loads" also as that makes more sense to me.
af6ba3d to
1dd5bb7
Compare
|
I also need to add a detailed change log here. |
dadd44f to
3d75c86
Compare
|
OK great, so we have some flags that we specifiy for |
3d75c86 to
b1d3bfd
Compare
Fixes #2219