From 68d5c18a750c30e5d65dda543be7bb44a55095c0 Mon Sep 17 00:00:00 2001 From: korikuzma Date: Fri, 10 Nov 2023 11:28:39 -0500 Subject: [PATCH] rm noqa e501s that arent needed --- src/therapy/database.py | 4 ++-- src/therapy/etl/chembl.py | 2 +- src/therapy/etl/guidetopharmacology.py | 12 ++++++------ src/therapy/etl/hemonc.py | 2 +- src/therapy/etl/rxnorm.py | 2 +- src/therapy/schemas.py | 2 +- tests/unit/test_chembl.py | 2 +- tests/unit/test_chemidplus.py | 4 ++-- tests/unit/test_disease_indication.py | 2 +- tests/unit/test_drugbank.py | 2 +- tests/unit/test_drugsatfda.py | 4 ++-- tests/unit/test_hemonc.py | 4 ++-- tests/unit/test_query.py | 4 ++-- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/therapy/database.py b/src/therapy/database.py index 85c4edbc..481547b4 100644 --- a/src/therapy/database.py +++ b/src/therapy/database.py @@ -68,12 +68,12 @@ def __init__(self, db_url: str = "", region_name: str = "us-east-2") -> None: if aws_env not in VALID_AWS_ENV_NAMES: raise DatabaseException( f"{AWS_ENV_VAR_NAME} must be one of {VALID_AWS_ENV_NAMES}" - ) # noqa: E501 + ) skip_confirmation = environ.get(SKIP_AWS_DB_ENV_NAME) if (not skip_confirmation) or ( skip_confirmation and skip_confirmation != "true" - ): # noqa: E501 + ): confirm_aws_db_use(environ[AWS_ENV_VAR_NAME]) boto_params = {"region_name": region_name} diff --git a/src/therapy/etl/chembl.py b/src/therapy/etl/chembl.py index 49c661e5..aa1f77f1 100644 --- a/src/therapy/etl/chembl.py +++ b/src/therapy/etl/chembl.py @@ -190,7 +190,7 @@ def _load_meta(self) -> None: """Add ChEMBL metadata.""" metadata = SourceMeta( data_license="CC BY-SA 3.0", - data_license_url="https://creativecommons.org/licenses/by-sa/3.0/", # noqa: E501 + data_license_url="https://creativecommons.org/licenses/by-sa/3.0/", version=self._version, data_url=bioversions.resolve("chembl").homepage, rdp_url="http://reusabledata.org/chembl.html", diff --git a/src/therapy/etl/guidetopharmacology.py b/src/therapy/etl/guidetopharmacology.py index 6752ade3..406a6ad2 100644 --- a/src/therapy/etl/guidetopharmacology.py +++ b/src/therapy/etl/guidetopharmacology.py @@ -29,7 +29,7 @@ def _download_data(self) -> None: assert self._ligands_file.exists() if not self._mapping_file.exists(): self._http_download( - "https://www.guidetopharmacology.org/DATA/ligand_id_mapping.tsv", # noqa: E501 + "https://www.guidetopharmacology.org/DATA/ligand_id_mapping.tsv", self._mapping_file, ) assert self._mapping_file.exists() @@ -78,7 +78,7 @@ def _extract_data(self, use_existing: bool = False) -> None: ) check_mapping_file = ( self._src_dir / f"{prefix}_ligand_id_mapping_{version}.tsv" - ) # noqa: E501 + ) if check_mapping_file.exists(): self._version = version self._ligands_file = ligands_file @@ -95,7 +95,7 @@ def _extract_data(self, use_existing: bool = False) -> None: self._ligands_file = self._src_dir / f"{prefix}_ligands_{self._version}.tsv" self._mapping_file = ( self._src_dir / f"{prefix}_ligand_id_mapping_{self._version}.tsv" - ) # noqa: E501 + ) if not (self._ligands_file.exists() and self._mapping_file.exists()): self._download_data() assert self._ligands_file.exists() @@ -176,11 +176,11 @@ def _transform_ligands(self, data: Dict) -> None: if row[8]: associated_with.append( f"{NamespacePrefix.PUBCHEMSUBSTANCE.value}:{row[8]}" - ) # noqa: E501 + ) if row[9]: associated_with.append( f"{NamespacePrefix.PUBCHEMCOMPOUND.value}:{row[9]}" - ) # noqa: E501 + ) if row[10]: associated_with.append(f"{NamespacePrefix.UNIPROT.value}:{row[10]}") if row[16]: @@ -202,7 +202,7 @@ def _transform_ligands(self, data: Dict) -> None: if row[20]: associated_with.append( f"{NamespacePrefix.INCHIKEY.value}:{row[20]}" - ) # noqa: E501 + ) if associated_with: params["associated_with"] = associated_with diff --git a/src/therapy/etl/hemonc.py b/src/therapy/etl/hemonc.py index d565316b..2894b11f 100644 --- a/src/therapy/etl/hemonc.py +++ b/src/therapy/etl/hemonc.py @@ -33,7 +33,7 @@ def get_latest_version(self) -> str: """ response = requests.get( "https://dataverse.harvard.edu/api/datasets/export?persistentId=doi:10.7910/DVN/9CY9C6&exporter=dataverse_json" - ) # noqa: E501 + ) try: response.raise_for_status() except requests.HTTPError as e: diff --git a/src/therapy/etl/rxnorm.py b/src/therapy/etl/rxnorm.py index 81cca993..3717c77e 100644 --- a/src/therapy/etl/rxnorm.py +++ b/src/therapy/etl/rxnorm.py @@ -63,7 +63,7 @@ def _create_drug_form_yaml(self) -> None: """Create a YAML file containing RxNorm drug form values.""" self._drug_forms_file = ( self._src_dir / f"rxnorm_drug_forms_{self._version}.yaml" - ) # noqa: E501 + ) dfs = [] with open(self._src_file) as f: # type: ignore data = csv.reader(f, delimiter="|") diff --git a/src/therapy/schemas.py b/src/therapy/schemas.py index 375d089c..62be66b8 100644 --- a/src/therapy/schemas.py +++ b/src/therapy/schemas.py @@ -615,7 +615,7 @@ class NormalizationService(BaseNormalizationService): "data_license": "custom", "data_license_url": "https://www.nlm.nih.gov/databases/download/terms_and_conditions.html", # noqa: E501 "version": "20200327", - "data_url": "ftp://ftp.nlm.nih.gov/nlmdata/.chemidlease/", # noqa: E501 + "data_url": "ftp://ftp.nlm.nih.gov/nlmdata/.chemidlease/", "rdp_url": None, "data_license_attributes": { "non_commercial": False, diff --git a/tests/unit/test_chembl.py b/tests/unit/test_chembl.py index f583c55d..9ec51cef 100644 --- a/tests/unit/test_chembl.py +++ b/tests/unit/test_chembl.py @@ -238,7 +238,7 @@ def test_meta_info(chembl): assert response.source_meta_.version == "31" assert response.source_meta_.data_url.startswith( "ftp://ftp.ebi.ac.uk/pub/databases/chembl/ChEMBLdb" - ) # noqa: E501 + ) assert response.source_meta_.rdp_url == "http://reusabledata.org/chembl.html" assert response.source_meta_.data_license_attributes == { "non_commercial": False, diff --git a/tests/unit/test_chemidplus.py b/tests/unit/test_chemidplus.py index 399cc3a2..dbb9c97c 100644 --- a/tests/unit/test_chemidplus.py +++ b/tests/unit/test_chemidplus.py @@ -205,11 +205,11 @@ def test_meta(chemidplus): assert ( response.source_meta_.data_license_url == "https://www.nlm.nih.gov/databases/download/terms_and_conditions.html" - ) # noqa: E501 + ) assert isodate.parse_date(response.source_meta_.version) assert ( response.source_meta_.data_url == "ftp://ftp.nlm.nih.gov/nlmdata/.chemidlease/" - ) # noqa: E501 + ) assert response.source_meta_.rdp_url is None assert response.source_meta_.data_license_attributes == { "non_commercial": False, diff --git a/tests/unit/test_disease_indication.py b/tests/unit/test_disease_indication.py index 50e328ea..ce112b77 100644 --- a/tests/unit/test_disease_indication.py +++ b/tests/unit/test_disease_indication.py @@ -11,7 +11,7 @@ RUN_TEST = ( os.environ.get("THERAPY_TEST", "").lower() == "true" and AWS_ENV_VAR_NAME not in os.environ -) # noqa: E501 +) class TestDiseaseIndication(DiseaseIndicationBase): diff --git a/tests/unit/test_drugbank.py b/tests/unit/test_drugbank.py index d6ba89a1..5db153d9 100644 --- a/tests/unit/test_drugbank.py +++ b/tests/unit/test_drugbank.py @@ -201,7 +201,7 @@ def test_meta_info(drugbank): assert ( response.data_license_url == "https://creativecommons.org/publicdomain/zero/1.0/" - ) # noqa: E501 + ) assert re.match(r"[0-9]+\.[0-9]+\.[0-9]", response.version) assert response.data_url == "https://go.drugbank.com/releases/latest#open-data" assert response.rdp_url == "http://reusabledata.org/drugbank.html" diff --git a/tests/unit/test_drugsatfda.py b/tests/unit/test_drugsatfda.py index 422e8917..cf7d2528 100644 --- a/tests/unit/test_drugsatfda.py +++ b/tests/unit/test_drugsatfda.py @@ -448,12 +448,12 @@ def test_meta(drugsatfda): assert ( response.source_meta_.data_license_url == "https://creativecommons.org/publicdomain/zero/1.0/legalcode" - ) # noqa: E501 + ) assert isodate.parse_date(response.source_meta_.version) assert ( response.source_meta_.data_url == "https://open.fda.gov/apis/drug/drugsfda/download/" - ) # noqa: E501 + ) assert response.source_meta_.rdp_url is None assert response.source_meta_.data_license_attributes == { "non_commercial": False, diff --git a/tests/unit/test_hemonc.py b/tests/unit/test_hemonc.py index 56466cfd..4e043f3e 100644 --- a/tests/unit/test_hemonc.py +++ b/tests/unit/test_hemonc.py @@ -218,12 +218,12 @@ def test_metadata(hemonc): assert ( response.data_license_url == "https://creativecommons.org/licenses/by/4.0/legalcode" - ) # noqa: E501 + ) assert isodate.parse_date(response.version) assert ( response.data_url == "https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/9CY9C6" - ) # noqa: E501 + ) assert response.rdp_url is None assert response.data_license_attributes == { "non_commercial": False, diff --git a/tests/unit/test_query.py b/tests/unit/test_query.py index dbbdf5c0..88b98d75 100644 --- a/tests/unit/test_query.py +++ b/tests/unit/test_query.py @@ -772,14 +772,14 @@ def test_service_meta(search_handler, normalize_handler): assert service_meta.name == "thera-py" assert service_meta.version >= "0.2.13" assert isinstance(service_meta.response_datetime, datetime) - assert service_meta.url == "https://github.com/cancervariants/therapy-normalization" # noqa: E501 + assert service_meta.url == "https://github.com/cancervariants/therapy-normalization" response = normalize_handler.normalize(query) service_meta = response.service_meta_ assert service_meta.name == "thera-py" assert service_meta.version >= "0.2.13" assert isinstance(service_meta.response_datetime, datetime) - assert service_meta.url == "https://github.com/cancervariants/therapy-normalization" # noqa: E501 + assert service_meta.url == "https://github.com/cancervariants/therapy-normalization" def test_broken_db_handling(normalize_handler):