-
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
Structured array highlevel accessors #3098
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3098 +/- ##
=======================================
Coverage 89.92% 89.93%
=======================================
Files 29 29
Lines 32362 32389 +27
Branches 5802 5802
=======================================
+ Hits 29101 29128 +27
Misses 1859 1859
Partials 1402 1402
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
941ba92
to
2e25635
Compare
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.
Looks good
@@ -10760,7 +10760,7 @@ TreeSequence_get_individuals_metadata_offset(TreeSequence *self, void *closure) | |||
} | |||
individuals = self->tree_sequence->tables->individuals; | |||
ret = TreeSequence_make_array( | |||
self, individuals.num_rows + 1, NPY_UINT32, individuals.metadata_offset); | |||
self, individuals.num_rows + 1, NPY_UINT64, individuals.metadata_offset); |
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.
Hmm, did the tests pass before because we didn't look at the contents of the offset arrays?
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.
Yeah, the low-level tests don't check the contents, just the semantics and lifetime/memory concerns.
python/tskit/trees.py
Outdated
) | ||
|
||
@property | ||
def individuals_metadata_offset(self): |
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 we want to offer this array in the high-level API. It may just be confusing. I would pull this out of the current PR, as it's orthogonal
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.
Offset accessors removed in b74b824
@jeromekelleher one more thought here - we could return the raw metadata bytes if the codec doesn't support structuring? |
Let's not - maybe we'll think of a better way of doing things in future and having it error out now leaves those options open. |
No description provided.