Skip to content

Conversation

@hyanwong
Copy link
Member

@hyanwong hyanwong commented Dec 24, 2025

This confused me, and was the reason that I couldn't canonicalise node 0 such that it pointed to individual 0 (see below and message on slack):

import tskit
print("Tskit version:", tskit.__version__)
ts = tskit.load("canonicalize_issue.trees")
print("Node in orig ts:", ts.node(0))
tables = ts.dump_tables()
tables.canonicalise()
print("Node in canonicalised ts (which I am trying to force with individual id=0):", tables.nodes[0])
ts = tables.tree_sequence()
print("Actual individual 0 in canonicalised has the following nodes:", ts.individual(0).nodes)
Tskit version: 1.0.0
Node in orig ts: Node(id=0, flags=1, time=0.0, population=0, individual=7, metadata=b'')
Node in canonicalised ts (which I am trying to force with individual id=0): NodeTableRow(flags=1, time=0.0, population=0, individual=7, metadata=b'')
Actual individual 0 in canonicalised has the following nodes: [46 47]

@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.76%. Comparing base (25a26a7) to head (d37fe17).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3355   +/-   ##
=======================================
  Coverage   89.76%   89.76%           
=======================================
  Files          29       29           
  Lines       31292    31292           
  Branches     5738     5738           
=======================================
  Hits        28089    28089           
  Misses       1794     1794           
  Partials     1409     1409           
Flag Coverage Δ
c-tests 86.77% <ø> (ø)
lwt-tests 80.38% <ø> (ø)
python-c-tests 87.12% <ø> (ø)
python-tests 98.85% <ø> (ø)
python-tests-no-jit 33.51% <ø> (ø)
python-tests-numpy1 50.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
python/tskit/tables.py 99.77% <ø> (ø)
python/tskit/trees.py 98.89% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petrelharp
Copy link
Contributor

Mind pointing to the part(s) of the code from which we know this is accurate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants