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
Method to update metadata with extra keys, warning if there is a clash. #1044
Python APIIssue is about the Python APIenhancementNew feature or requestfutureIssues that are closed as they are not planned in the medium-term, but which are still desirable.
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.
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.
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.
Python APIIssue is about the Python APIenhancementNew feature or requestfutureIssues that are closed as they are not planned in the medium-term, but which are still desirable.
Activity
jeromekelleher commentedon Nov 26, 2020
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.
benjeffery commentedon Nov 26, 2020
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.
jeromekelleher commentedon Nov 27, 2020
Agree.
benjeffery commentedon Jun 12, 2025
Closing for inactivity and labelling "future", please re-open if you plan to work on this.