From 7630a052f45bde70317e08a016ea1d695f6dba65 Mon Sep 17 00:00:00 2001 From: Aditya Raj Date: Sun, 7 Sep 2025 12:35:59 +0530 Subject: [PATCH] Added the dynamic path --- malariagen_data/anoph/phenotypes.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/malariagen_data/anoph/phenotypes.py b/malariagen_data/anoph/phenotypes.py index 265534f28..42ce27c5b 100644 --- a/malariagen_data/anoph/phenotypes.py +++ b/malariagen_data/anoph/phenotypes.py @@ -3,6 +3,7 @@ from typing import Callable, Optional, List, Any import warnings import fsspec +import posixpath from numpydoc_decorator import doc # type: ignore from ..util import check_types @@ -35,10 +36,12 @@ def _load_phenotype_data( Load raw phenotypic data from GCS for given sample sets. """ phenotype_dfs = [] - base_phenotype_path = f"{self._url}v3.2/phenotypes/all" + #base_phenotype_path = f"{self._url}v3.2/phenotypes/all" + release = getattr(self, "release", "v3.2") + base_phenotype_path = posixpath.join(self._url, release, "phenotypes", "all") for sample_set in sample_sets: - phenotype_path = f"{base_phenotype_path}/{sample_set}/phenotypes.csv" + phenotype_path = posixpath.join(base_phenotype_path,sample_set,"phenotypes.csv") try: if not self._fs.exists(phenotype_path): warnings.warn( @@ -480,7 +483,9 @@ def phenotype_sample_sets(self) -> List[str]: all_sample_sets = self.sample_sets()["sample_set"].tolist() # type: ignore[operator] phenotype_sample_sets = [] - base_phenotype_path = f"{self._url}v3.2/phenotypes/all" + #base_phenotype_path = f"{self._url}v3.2/phenotypes/all" + release = getattr(self,"release","v3.2") + base_phenotype_path = posixpath.join(self._url,release,"phenotypes","all") for sample_set in all_sample_sets: try: