Open jeromekelleher opened 2 years ago
Also Python testing of the variant state is needs beefing up. We need to test taking copies of copies, among other things.
We could consider renaming this to tsk_variant_frozen_copy
(keeping the current name as an alias)
We are currently using the
tree_sequence
attribute of a way of determining whether a variant is a frozen copy or not. We also use thevariant->site.position
attribute as a way of determining if the variant has been decoded. It would be simpler if we had a single state machine, which supported transitions:Thus,
tsk_variant_restricted_copy
should failtsk_variant_decode
should failThe current approach of using the
tree_sequence
is problematic becausesite
copy (e.g., the list of mutations is still pointing to memory from the original ts). Thus, we still have a dependency on the original ts. Note, we're currently getting away with this dependence in the Python C API layer because we don't refer to the pointers within thesite
reference, but we could easily forget this some day.I think we can also remove some complexity in
tsk_variant_restricted_copy
because we can then avoid taking copies of the alleles in theuser_alleles
memory.