tskit
tskit copied to clipboard
Table collection returned by ts.tables not read-only.
One thing that has been bugging me is the description of mutability. If you have a tree sequence, calling the functions that change it do not raise an error (like the various
add_rowmethods). Rather, they just silently do nothing.
Originally posted by @molpopgen in https://github.com/tskit-dev/tskit/pull/756#issuecomment-670972776
It would be good to do this, and the plan is for the table collection to be read-only so that we can avoid taking copies when creating a new set of tables. However, I think there would be a fair bit of work required to do this at the Python level, and we'll still want to actually mark things as read-only at the C level (so we can be sure things are safe). So, I think we should just tackle this properly when we do it.
Note: when we do this we should update the documentation for the arrays added in #2424 to take out the comment about ts.tables incurring a full table copy. There's also some other warnings scattered around the docs to find and remove.