You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add TreeSequence.node_time, node_population and node_flags arrays #1917
As we see in #1916, calling self.tables.nodes.time can be very expensive because we are currently forced to make a copy of the whole table collection just to get access to one array. This adds up when we're working with large tables. While fixing this properly is a long term project, we can fix the worst behaviour within the library at least by adding there arrays to the TreeSequence object, following the approach used for the tree arrays in the Tree class.
There's a question about whether we should make this interface public or not. I guess since it's a regular pain-point and we're not going to fix the read-only tables view thing any time in the immediate future, we probably should?
Does anyone want to take this on to get it into 0.4.0? @benjeffery and I are maxed out trying to get other stuff shipped I'm afraid.
Depends on whether there's any advantage ultimately to this vs TreeSequence.tables.nodes.time? I don't think there would be if we cached a reference to the TableCollection object, and it was in turn a read-only view on the underlying TreeSequence tables?
In that case it seem like a lot of work to take on and potentially quite confusing for users. This isn't the only reason we'd want to have a read-only copy of the tables in the tree sequence, since it would allow us to avoid a copy at load time too.
I'm not sure if this is worth it: right now, we can save out the tables once and referring to them (so, only 2x the memory). The worst of what happened in #1916 was because of mulitple calls to ts.tables.nodes.time.
We still have a few library functions that use ts.tables.nodes.time though (#1916) - we'd like those to not use huge amounts of RAM and take way longer than they should. If we don't document these arrays then it's not much work to make a big difference for #1916
Activity
benjeffery commentedon Nov 17, 2021
I wonder if we make this generic for all arrays, something like
TreeSequence.arrays.nodes.time?benjeffery commentedon Nov 17, 2021
Depends on if you see this as a short term fix or not I guess.
jeromekelleher commentedon Nov 17, 2021
Depends on whether there's any advantage ultimately to this vs
TreeSequence.tables.nodes.time? I don't think there would be if we cached a reference to the TableCollection object, and it was in turn a read-only view on the underlying TreeSequence tables?In that case it seem like a lot of work to take on and potentially quite confusing for users. This isn't the only reason we'd want to have a read-only copy of the tables in the tree sequence, since it would allow us to avoid a copy at load time too.
petrelharp commentedon Nov 17, 2021
I'm not sure if this is worth it: right now, we can save out the tables once and referring to them (so, only 2x the memory). The worst of what happened in #1916 was because of mulitple calls to
ts.tables.nodes.time.jeromekelleher commentedon Nov 17, 2021
We still have a few library functions that use
ts.tables.nodes.timethough (#1916) - we'd like those to not use huge amounts of RAM and take way longer than they should. If we don't document these arrays then it's not much work to make a big difference for #1916Add direct access to all non-ragged table arrays
Add direct access to all non-ragged table arrays
Add direct access to all non-ragged table arrays
Add direct access to all non-ragged table arrays
Add direct access to all non-ragged table arrays