From 4660866706833a3167a38772c3c891721804ef7d Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Sat, 28 Nov 2026 15:04:15 -0600 Subject: [PATCH] Fix documentation for incrementing VCF positions Sometimes the positions will be a list instead of a numpy array, so adding 1 to the list throws an error (because + is concatenation). Convert the list to an array first to prevent this. --- python/tskit/vcf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tskit/vcf.py b/python/tskit/vcf.py index c050c1a26a..8500c90967 100644 --- a/python/tskit/vcf.py +++ b/python/tskit/vcf.py @@ -112,7 +112,7 @@ def __init__( "fully compliant with the VCF spec. If you still wish to write the VCF " 'please use the "allow_position_zero" argument to write_vcf. ' "Alternatively, you can increment all the positions by one using " - '"position_transform = lambda x: 1 + x" or coerce the zero to one with ' + '"position_transform = lambda x: 1 + np.array(x)" or coerce the zero to one with ' '"position_transform = lambda x: np.fmax(1, x)"' )