Skip to content

Commit 7e58a86

Browse files
committed
more comments
1 parent 870d2be commit 7e58a86

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

malariagen_data/anoph/distance.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,15 @@ def biallelic_diplotype_pairwise_distances(
119119
# invalidate any previously cached data.
120120
name = "biallelic_diplotype_pairwise_distances"
121121

122+
# Check that either sample_query xor sample_indices are provided.
122123
base_params._validate_sample_selection_params(
123124
sample_query=sample_query, sample_indices=sample_indices
124125
)
125126

127+
## Normalize params for consistent hash value.
128+
129+
# Note: `_prep_sample_selection_cache_params` converts `sample_query` and `sample_query_options` into `sample_indices`.
130+
# So `sample_query` and `sample_query_options` should not be used beyond this point. (`sample_indices` should be used instead.)
126131
(
127132
sample_sets_prepped,
128133
sample_indices_prepped,

malariagen_data/anoph/snp_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,7 @@ def biallelic_snp_calls(
19221922
n_snps: Optional[base_params.n_snps] = None,
19231923
thin_offset: base_params.thin_offset = 0,
19241924
) -> xr.Dataset:
1925+
# Check that either sample_query xor sample_indices are provided.
19251926
base_params._validate_sample_selection_params(
19261927
sample_query=sample_query, sample_indices=sample_indices
19271928
)

0 commit comments

Comments
 (0)