@@ -253,7 +253,7 @@ def _site_filters_for_region(
253253 inline_array = inline_array ,
254254 chunks = chunks ,
255255 )
256- if region .start or region .end :
256+ if region .start is not None or region .end is not None :
257257 pos = self ._snp_sites_for_contig (
258258 contig = region .contig ,
259259 field = "POS" ,
@@ -353,7 +353,7 @@ def _snp_sites_for_region(
353353 )
354354
355355 # Deal with a region.
356- if region .start or region .end :
356+ if region .start is not None or region .end is not None :
357357 if field == "POS" :
358358 pos = ret
359359 else :
@@ -506,7 +506,7 @@ def snp_genotypes(
506506 x = _da_concat (ly , axis = 1 )
507507
508508 # Locate region - do this only once, optimisation.
509- if r .start or r .end :
509+ if r .start is not None or r .end is not None :
510510 pos = self ._snp_sites_for_contig (
511511 contig = contig ,
512512 field = "POS" ,
@@ -670,7 +670,7 @@ def snp_variants(
670670 )
671671
672672 # Handle region.
673- if r .start or r .end :
673+ if r .start is not None or r .end is not None :
674674 pos = x ["variant_position" ].values
675675 loc_region = _locate_region (r , pos )
676676 x = x .isel (variants = loc_region )
@@ -1141,7 +1141,7 @@ def _raw_snp_calls(
11411141 x = xr .merge ([v , x ], compat = "override" , join = "override" )
11421142
11431143 # Handle region, do this only once - optimisation.
1144- if r .start or r .end :
1144+ if r .start is not None or r .end is not None :
11451145 pos = x ["variant_position" ].values
11461146 loc_region = _locate_region (r , pos )
11471147 x = x .isel (variants = loc_region )
0 commit comments