Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

benjeffery
Copy link
Member

No description provided.

Copy link

codecov bot commented Mar 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.93%. Comparing base (a405996) to head (b74b824).

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           
Flag Coverage Δ
c-tests 86.71% <ø> (ø)
lwt-tests 80.78% <ø> (ø)
python-c-tests 89.23% <100.00%> (ø)
python-tests 98.98% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
python/_tskitmodule.c 89.23% <100.00%> (ø)
python/tskit/trees.py 98.82% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@benjeffery benjeffery force-pushed the structured-array-highlevel branch from 941ba92 to 2e25635 Compare March 7, 2025 13:28
@benjeffery benjeffery marked this pull request as ready for review March 7, 2025 13:28
Copy link
Member

@jeromekelleher jeromekelleher left a 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);
Copy link
Member

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?

Copy link
Member Author

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.

)

@property
def individuals_metadata_offset(self):
Copy link
Member

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

Copy link
Member Author

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

@benjeffery
Copy link
Member Author

@jeromekelleher one more thought here - we could return the raw metadata bytes if the codec doesn't support structuring?

@jeromekelleher
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants