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
Add assert_equal to TableCollection and TreeSequence #1076
The '.equalsmethod is very useful, but it doesn't tell us where the problem is when tables are not equal. We should add methodsassert_equal`` which would initially look like
defassert_equal(self, other, ignore_provenance=...) # same signature as equalsassertself.sequence_length==other.sequence_lengthassertself.nodes==other.nodes# etc
This would at least tell us which table the mismatch occurs in. We can imagine providing a more detailed picture of how tables differ at some point, but this could be added later as a refinement. This form assert_equal should integrate nicely with pytest, and clean up our testing code some more.
I've hit this again when debugging tsinfer msprime0.7.4->1.0.0 issues. It would be super useful to port @petrelharp 's code into tskit proper. How much work is it? Do the tests for the method already exist in pyslim?
Activity
hyanwong commentedon Dec 7, 2020
Definitely. The other way would be for the equality testing code to break at different places. E.g. if it were in python, you could do:
But AFAIK the comparison is in C, so I guess that's not so easy, and a separate
assert_equalsfunction (for Python only?) is a much easier win.jeromekelleher commentedon Dec 7, 2020
Yes, this is Python only.
petrelharp commentedon Dec 7, 2020
Here's a draft of that: https://github.com/tskit-dev/pyslim/blob/fe1f7fab11b5a529eacd6f404fcf32ba00c181a5/tests/__init__.py#L342
assert equal method (closes tskit-dev#1076)
removed restriction on union
removed restriction on union
removed restriction on union
removed restriction on union
jeromekelleher commentedon Feb 3, 2021
Reopening this, as we want it to be part of the public API.
hyanwong commentedon Apr 23, 2021
I've hit this again when debugging tsinfer msprime0.7.4->1.0.0 issues. It would be super useful to port @petrelharp 's code into tskit proper. How much work is it? Do the tests for the method already exist in pyslim?
benjeffery commentedon Apr 23, 2021
Was just working on this funnily enough! It will be in the next release, might be on
mainlater today.hyanwong commentedon Apr 23, 2021
You star, @benjeffery !