Skip to content

Table collection returned by ts.tables not read-only. #760

Closed

Description

@jeromekelleher

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_row methods). Rather, they just silently do nothing.

Originally posted by @molpopgen in #756 (comment)

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.

Activity

  1. added this to the milestone on Jul 21, 2022
  2. added
    Python API
    on Jul 22, 2022
  3. jeromekelleher commented on Jul 22, 2022

    @jeromekelleher
    MemberAuthor

    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.

  4. added
    enhancement
    on Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Python APIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions