Skip to content

Commit 51f101e

Browse files
committed
fix: adapt cohort group metadata API to current anoph interfaces
1 parent 1da32f2 commit 51f101e

3 files changed

Lines changed: 11 additions & 22 deletions

File tree

malariagen_data/anoph/base_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@
8181
""",
8282
]
8383

84+
cohort_group_query: TypeAlias = Annotated[
85+
str,
86+
"""
87+
A pandas query string to be evaluated against cohort-group metadata.
88+
""",
89+
]
90+
8491
sample_indices: TypeAlias = Annotated[
8592
List[int],
8693
"""

malariagen_data/anoph/cohort_group_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pandas as pd
44
from numpydoc_decorator import doc
55

6-
from ..util import check_types
6+
from ..util import _check_types
77
from . import base_params
88
from .base import AnophelesBase
99

@@ -18,7 +18,7 @@ def __init__(
1818
# to the superclass constructor.
1919
super().__init__(**kwargs)
2020

21-
@check_types
21+
@_check_types
2222
@doc(
2323
summary="""
2424
Read metadata for a specific cohort group, including cohort size,

tests/anoph/test_cohort_group_metadata.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,25 @@
11
import pytest
22
from pytest_cases import parametrize_with_cases
33

4-
from malariagen_data import af1 as _af1
54
from malariagen_data import ag3 as _ag3
65
from malariagen_data.anoph.cohort_group_metadata import AnophelesCohortGroupMetadata
76

87

98
@pytest.fixture
109
def ag3_sim_api(ag3_sim_fixture):
1110
return AnophelesCohortGroupMetadata(
12-
url=ag3_sim_fixture.url,
11+
url=ag3_sim_fixture.bucket_path.as_posix(),
12+
public_url=ag3_sim_fixture.bucket_path.as_posix(),
1313
config_path=_ag3.CONFIG_PATH,
14-
gcs_url=_ag3.GCS_URL,
1514
major_version_number=_ag3.MAJOR_VERSION_NUMBER,
1615
major_version_path=_ag3.MAJOR_VERSION_PATH,
1716
pre=True,
1817
)
1918

20-
21-
@pytest.fixture
22-
def af1_sim_api(af1_sim_fixture):
23-
return AnophelesCohortGroupMetadata(
24-
url=af1_sim_fixture.url,
25-
config_path=_af1.CONFIG_PATH,
26-
gcs_url=_af1.GCS_URL,
27-
major_version_number=_af1.MAJOR_VERSION_NUMBER,
28-
major_version_path=_af1.MAJOR_VERSION_PATH,
29-
pre=False,
30-
)
31-
32-
3319
def case_ag3_sim(ag3_sim_fixture, ag3_sim_api):
3420
return ag3_sim_fixture, ag3_sim_api
3521

3622

37-
def case_af1_sim(af1_sim_fixture, af1_sim_api):
38-
return af1_sim_fixture, af1_sim_api
39-
40-
4123
def cohort_group_metadata_expected_columns():
4224
return {
4325
"cohort_id": "O",

0 commit comments

Comments
 (0)