From 45865b09afd2130e8f0fdcb6ede8c0d869e7d93c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karatu=C4=9F=20Ozan=20Bircan?= Date: Thu, 18 Apr 2024 17:17:08 +0100 Subject: [PATCH] chore: Bump version to 1.0.19 --- gwas_sumstats_tools/config.py | 10 ++++------ gwas_sumstats_tools/interfaces/metadata.py | 11 +++-------- pyproject.toml | 2 +- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/gwas_sumstats_tools/config.py b/gwas_sumstats_tools/config.py index 323a3e5..048c7ac 100755 --- a/gwas_sumstats_tools/config.py +++ b/gwas_sumstats_tools/config.py @@ -19,15 +19,13 @@ def _env_variable_else(env_var_name: str, default: str) -> str: "GWAS_CAT_API_STUDIES_URL", "https://www.ebi.ac.uk/gwas/rest/api/studies/" ) -GWAS_CAT_API_INGEST_STUDIES_URL = _env_variable_else( - "GWAS_CAT_API_INGEST_STUDIES_URL", +URL_API_INGEST = _env_variable_else( + "URL_API_INGEST", "https://www.ebi.ac.uk/gwas/ingest/api/v2/studies/", + # if sandbox, then use + # "https://wwwdev.ebi.ac.uk/gwas/ingest/api/v2/studies/", ) -GWAS_CAT_API_INGEST_STUDIES_URL_SANDBOX = _env_variable_else( - "GWAS_CAT_API_INGEST_STUDIES_URL_SANDBOX", - "https://wwwdev.ebi.ac.uk/gwas/ingest/api/v2/studies/", -) GWAS_CAT_STUDY_MAPPINGS = { "genotyping_technology": "genotyping_technology", diff --git a/gwas_sumstats_tools/interfaces/metadata.py b/gwas_sumstats_tools/interfaces/metadata.py index 19f6f05..c318b31 100755 --- a/gwas_sumstats_tools/interfaces/metadata.py +++ b/gwas_sumstats_tools/interfaces/metadata.py @@ -7,8 +7,7 @@ from pydantic import ValidationError from gwas_sumstats_tools.config import (GWAS_CAT_API_STUDIES_URL, - GWAS_CAT_API_INGEST_STUDIES_URL, - GWAS_CAT_API_INGEST_STUDIES_URL_SANDBOX, + URL_API_INGEST, GWAS_CAT_STUDY_MAPPINGS, REST_GWAS_CAT_STUDY_MAPPINGS, STUDY_FIELD_TO_SPLIT, @@ -131,7 +130,6 @@ def comment_token(s, mark): def metadata_dict_from_gwas_cat( accession_id: str, is_bypass_rest_api: bool = False, - is_sandbox: bool = False, ) -> dict: """Extract metadat from the GWAS Catalog API @@ -140,8 +138,6 @@ def metadata_dict_from_gwas_cat( is_bypass_rest_api(bool, optional): A flag indicating whether the request comes from the sumstats service. If True, the function bypasses querying the REST API for additional study metadata. Defaults to False, which means the REST API response will be included in the metadata dict. - is_sandbox(bool, optional): A A flag indicating whether the request comes from the sandbox sumstats - service. Returns: Metadata dict @@ -149,10 +145,9 @@ def metadata_dict_from_gwas_cat( meta_dict = {} sample_list = [] ### DEV ONLY ###### - # if is_sandbox: - # study_url = GWAS_CAT_API_INGEST_STUDIES_URL_SANDBOX + accession_id + # if sandbox, then update URL_API_INGEST in config ################### - study_url = GWAS_CAT_API_INGEST_STUDIES_URL + accession_id + study_url = URL_API_INGEST + accession_id sample_url = study_url + "/samples" rest_url = GWAS_CAT_API_STUDIES_URL + accession_id diff --git a/pyproject.toml b/pyproject.toml index 3992aa7..3808c4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gwas-sumstats-tools" -version = "1.0.18" +version = "1.0.19" description = "" authors = ["jdhayhurst "] readme = "README.md"