Skip to content

Commit 717136d

Browse files
committed
Some slight updates
2 parents 511f0b1 + 118d25e commit 717136d

14 files changed

+802
-712
lines changed

malariagen_data/anoph/sample_metadata.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import io
22
from itertools import cycle
3-
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union
3+
from typing import (
4+
Any,
5+
Callable,
6+
Dict,
7+
List,
8+
Mapping,
9+
Optional,
10+
Sequence,
11+
Tuple,
12+
Union,
13+
)
414

515
import ipyleaflet # type: ignore
616
import numpy as np
@@ -891,7 +901,9 @@ def _prep_sample_selection_cache_params(
891901
# integer indices instead.
892902
df_samples = self.sample_metadata(sample_sets=sample_sets)
893903
sample_query_options = sample_query_options or {}
894-
loc_samples = df_samples.eval(sample_query, **sample_query_options).values
904+
loc_samples = (
905+
df_samples.eval(sample_query, **sample_query_options).values,
906+
)
895907
sample_indices = np.nonzero(loc_samples)[0].tolist()
896908

897909
return sample_sets, sample_indices

malariagen_data/anoph/snp_frq.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from numpydoc_decorator import doc # type: ignore
88
import xarray as xr
99
import numba # type: ignore
10-
1110
from .. import veff
1211
from ..util import (
1312
check_types,
@@ -576,8 +575,8 @@ def snp_allele_frequencies_advanced(
576575
raise ValueError("No SNPs remaining after dropping invariant SNPs.")
577576

578577
df_variants = df_variants.loc[loc_variant].reset_index(drop=True)
579-
count = np.compress(loc_variant, count, axis=0)
580-
nobs = np.compress(loc_variant, nobs, axis=0)
578+
count = np.compress(loc_variant, count, axis=0).reshape(-1, count.shape[1])
579+
nobs = np.compress(loc_variant, nobs, axis=0).reshape(-1, nobs.shape[1])
581580
frequency = np.compress(loc_variant, frequency, axis=0)
582581

583582
# Set up variant effect annotator.

poetry.lock

Lines changed: 673 additions & 623 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ license = "MIT"
2121

2222
[tool.poetry.dependencies]
2323
python = ">=3.10,<3.13"
24-
numpy = "<2.2"
24+
numpy = ">=2.2"
2525
numba = ">=0.60.0"
2626
llvmlite = "*"
2727
scipy = "*"

0 commit comments

Comments
 (0)