Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undefined names #679

Merged
merged 3 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/hgvs/dataproviders/uta.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ def connect(db_url=None, pooling=hgvs.global_config.uta.pooling, application_nam
_logger.warning(f"You are executing tests using remote data ({db_url})")

url = _parse_url(db_url)
if url.scheme == "sqlite":
conn = UTA_sqlite(url, mode, cache)
elif url.scheme == "postgresql":
if url.scheme == "postgresql":
conn = UTA_postgresql(url=url, pooling=pooling, application_name=application_name, mode=mode, cache=cache)
else:
# fell through connection scheme cases
Expand Down
2 changes: 2 additions & 0 deletions src/hgvs/normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
import hgvs
import hgvs.validator
import hgvs.variantmapper
from hgvs.dataproviders.ncbi import connect
from hgvs.exceptions import (HGVSDataNotAvailableError,
HGVSInvalidVariantError,
HGVSUnsupportedOperationError)
from hgvs.parser import Parser
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduced a circular dependency from Parser <-> normalizer

from hgvs.utils.norm import normalize_alleles

_logger = logging.getLogger(__name__)
Expand Down
12 changes: 6 additions & 6 deletions tests/test_hgvs_alignmentmapper.py
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added these changes since last reviewed, had neglected to run ruff on the tests/ path.

Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ def x_test_alignmentmapper_AlignmentMapper_LCE3C_uncertain(self):
alt_ac = "NC_000001.10"
test_cases = [
{
"g": parser.parse_g_interval("(?_152573139)"),
"n": parser.parse_n_interval("(?_2)"),
"c": parser.parse_c_interval("(?_-69)"),
"g": self.parser.parse_g_interval("(?_152573139)"),
"n": self.parser.parse_n_interval("(?_2)"),
"c": self.parser.parse_c_interval("(?_-69)"),
},
{
"g": parser.parse_g_interval("(152573138_?)"),
"n": parser.parse_n_interval("(1_?)"),
"c": parser.parse_c_interval("(-70_?)"),
"g": self.parser.parse_g_interval("(152573138_?)"),
"n": self.parser.parse_n_interval("(1_?)"),
"c": self.parser.parse_c_interval("(-70_?)"),
},
]
self.run_cases(tx_ac, alt_ac, test_cases)
Expand Down