Skip to content

Method to update metadata with extra keys, warning if there is a clash. #1044

Closed as not planned

Description

@benjeffery

As discussed over at tskit-dev/msprime#1316 we can imagine downstream tools will wish to add to existing metadata. tskit should provide a method to do this where it raises a warning if metadata is being over written. It might be nice to add an option to suppress this warning - and also to elevate it to an exception.

Activity

  1. added
    enhancement
    Python API
    on Nov 26, 2020
  2. added this to the Python upcoming milestone on Nov 26, 2020
  3. jeromekelleher commented on Nov 26, 2020

    @jeromekelleher
    Member

    So I guess we can only really imagine this making sense on a row-by-row basis, so something like XTable.update_metadata(self, index, extra_metadata)? It would mean we'd need some fairly easy way of updating row data, but I think we're overdue for that anyway.

    Totally agree on the other args, btw.

  4. benjeffery commented on Nov 26, 2020

    @benjeffery
    MemberAuthor

    A bulk method would also be possible if it turns out that row-by-row updating of the ragged array is too slow. I guess that would only be the case for large tables as I expect the decode-update-encode part to dominate.

  5. jeromekelleher commented on Nov 27, 2020

    @jeromekelleher
    Member

    Agree.

  6. removed this from the Python upcoming milestone on Jun 12, 2025
  7. added
    future
    on Jun 12, 2025
  8. benjeffery commented on Jun 12, 2025

    @benjeffery
    MemberAuthor

    Closing for inactivity and labelling "future", please re-open if you plan to work on this.

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 APIenhancementfuture

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions