Skip to content

Commit 9da7fc3

Browse files
author
khushthecoder
committed
Fix mypy errors: add type: ignore for dask.config.set() calls
1 parent f7cddbf commit 9da7fc3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

malariagen_data/anoph/snp_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,13 +610,13 @@ def snp_genotypes(
610610
)
611611

612612
# Filter the Dask array using the boolean array.
613-
with dask.config.set(**{"array.slicing.split_native_chunks": False}):
613+
with dask.config.set({"array.slicing.split_native_chunks": False}): # type: ignore[arg-type]
614614
d = da.compress(loc_samples, d, axis=1)
615615

616616
# Apply the sample_indices, if there are any.
617617
# Note: this might need to apply to the result of an internal sample_query, e.g. `is_surveillance == True`.
618618
if sample_indices is not None:
619-
with dask.config.set(**{"array.slicing.split_native_chunks": False}):
619+
with dask.config.set({"array.slicing.split_native_chunks": False}): # type: ignore[arg-type]
620620
d = da.take(d, sample_indices, axis=1)
621621

622622
return d
@@ -1020,7 +1020,7 @@ def _locate_site_class(
10201020
chunks=chunks,
10211021
)
10221022
idx = (pos - 1).compute()
1023-
with dask.config.set(**{"array.slicing.split_native_chunks": False}):
1023+
with dask.config.set({"array.slicing.split_native_chunks": False}): # type: ignore[arg-type]
10241024
loc_ann = da.take(loc_ann, idx, axis=0)
10251025

10261026
# Compute site selection.

malariagen_data/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def _da_compress(
411411
# Apply the indexing operation, suppressing the dask performance warning
412412
# about split_native_chunks. This config is scoped here rather than at
413413
# module level to avoid silently modifying global dask configuration.
414-
with dask.config.set(**{"array.slicing.split_native_chunks": False}):
414+
with dask.config.set({"array.slicing.split_native_chunks": False}): # type: ignore[arg-type]
415415
v = da.compress(indexer, data, axis=axis)
416416

417417
# Need to compute chunks sizes in order to know dimension sizes;

0 commit comments

Comments
 (0)