Skip to content

Commit 4d0dd66

Browse files
authored
Merge branch 'master' into fix/empty-cohort-queries-guard
2 parents 53c595b + 4595147 commit 4d0dd66

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

malariagen_data/anoph/hap_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _haplotype_sites_for_region(
143143
)
144144

145145
# Deal with a region.
146-
if region.start or region.end:
146+
if region.start is not None or region.end is not None:
147147
if field == "POS":
148148
pos = ret
149149
else:
@@ -385,7 +385,7 @@ def haplotypes(
385385
x = _simple_xarray_concat(ly, dim=DIM_SAMPLE)
386386

387387
# Handle region.
388-
if r.start or r.end:
388+
if r.start is not None or r.end is not None:
389389
pos = x["variant_position"].values
390390
loc_region = _locate_region(r, pos)
391391
x = x.isel(variants=loc_region)

malariagen_data/anoph/snp_data.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)