Skip to content

Commit

Permalink
rm noqa e501s that arent needed
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma committed Nov 10, 2023
1 parent 2162564 commit 68d5c18
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/therapy/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion src/therapy/etl/chembl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions src/therapy/etl/guidetopharmacology.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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]:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/therapy/etl/hemonc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/therapy/etl/rxnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="|")
Expand Down
2 changes: 1 addition & 1 deletion src/therapy/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_chembl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_chemidplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_disease_indication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_drugbank.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_drugsatfda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_hemonc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 68d5c18

Please sign in to comment.