Skip to content

Commit 8e2fce4

Browse files
authored
Merge pull request #966 from adilraza99/GH965-g123-cache-key-fix
Normalize site_mask in g123_gwss cache parameters and bump cache version
2 parents 532d574 + c5d5741 commit 8e2fce4

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

malariagen_data/anoph/g123.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def g123_gwss(
170170
) -> Tuple[np.ndarray, np.ndarray]:
171171
# Change this name if you ever change the behaviour of this function, to
172172
# invalidate any previously cached data.
173-
name = "g123_gwss_v1"
173+
name = "g123_gwss_v2"
174174

175175
valid_sites = self.phasing_analysis_ids + ("all", "segregating")
176176
if sites not in valid_sites:
@@ -181,7 +181,7 @@ def g123_gwss(
181181
params = dict(
182182
contig=contig,
183183
sites=sites,
184-
site_mask=site_mask,
184+
site_mask=self._prep_optional_site_mask_param(site_mask=site_mask),
185185
window_size=window_size,
186186
sample_sets=self._prep_sample_sets_param(sample_sets=sample_sets),
187187
# N.B., do not be tempted to convert this sample query into integer

tests/anoph/test_g123.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ def test_g123_calibration(fixture, api: AnophelesG123Analysis):
240240

241241
# Set up test parameters.
242242
all_sample_sets = api.sample_sets()["sample_set"].to_list()
243-
window_sizes = np.random.randint(100, 500, size=random.randint(2, 5)).tolist()
244-
window_sizes = sorted([int(x) for x in window_sizes])
243+
window_sizes = sorted(random.sample(range(100, 500), k=random.randint(2, 5)))
245244
g123_params = dict(
246245
contig=random.choice(api.contigs),
247246
sites=random.choice(api.phasing_analysis_ids),

0 commit comments

Comments
 (0)