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

Column access to tables #19

Closed
hyanwong opened this issue Sep 29, 2023 · 2 comments · Fixed by #31
Closed

Column access to tables #19

hyanwong opened this issue Sep 29, 2023 · 2 comments · Fixed by #31
Assignees

Comments

@hyanwong
Copy link
Owner

hyanwong commented Sep 29, 2023

With #17 we have defined a simple table structure, but we have no simple way to get a numpy array of the columns, for instance, we might hope to be able to get

child_left = TableCollection.intervals.child_left

Or even set a whole column:

TableCollection.intervals.child_left = child_left +1

(we can't even do the latter in tskit, though)

@duncanMR
Copy link
Collaborator

duncanMR commented Oct 2, 2023

I'd be happy to take this one on. I will see if I can replicate how its done with tskit data.

@hyanwong
Copy link
Owner Author

hyanwong commented Oct 2, 2023

Great. We could probably do a bit better than tskit for the interface. For example, it would be good to have something like this:

tskit-dev/tskit#2015

It would be much better if we could use tables.nodes.time[x] to get direct memory access, rather than the somewhat clunky ts.nodes_time[x]. You might well want to talk to @benjeffery about this.

Do make sure, however, that we aren' "prematurely optimising". For the size of datasets we are experimenting on, there's no need to make this fast (yet). It's better to get a slow API that can be sped up later, under the hood.

Once we get to this stage, it's vital to start setting up unit tests, so #20 is important to tackle at the same time.

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 a pull request may close this issue.

2 participants