Skip to content

Commit 31a9fb5

Browse files
committed
Cleanup comments and signatures
1 parent e2358c4 commit 31a9fb5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

pyard/db.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pathlib
22
import sqlite3
3-
from typing import Tuple, Dict, Union, Set, List
3+
from typing import Tuple, Dict, Set, List
44

55

66
def create_db_connection(data_dir, imgt_version, ro=False):
@@ -53,7 +53,7 @@ def table_exists(connection: sqlite3.Connection, table_name: str) -> bool:
5353
return result[0] > 0
5454

5555

56-
def tables_exists(connection: sqlite3.Connection, table_names):
56+
def tables_exists(connection: sqlite3.Connection, table_names: List[str]):
5757
"""
5858
Do all the given tables exist in the database ?
5959
@@ -98,7 +98,8 @@ def is_valid_mac_code(connection: sqlite3.Connection, code: str) -> bool:
9898
return result[0] > 0
9999

100100

101-
def save_dict(connection: sqlite3.Connection, table_name: str, dictionary: Union[Dict, Set], columns=Tuple[str, str]) -> bool:
101+
def save_dict(connection: sqlite3.Connection, table_name: str,
102+
dictionary: Dict[str, str], columns=Tuple[str, str]) -> bool:
102103
"""
103104
Save the dictionary as a table with column names from columns Tuple.
104105

pyard/pyard.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ def redux(self, allele: str, ars_type: str) -> str:
114114
if allele in self._lg:
115115
return self._lg[allele]
116116
else:
117-
# for 'lg' when mac_code is not in G group,
118-
# return mac_code with only first 2 field
117+
# for 'lg' when allele is not in G group,
118+
# return allele with only first 2 field
119119
return ':'.join(allele.split(':')[0:2]) + 'g'
120120
elif ars_type == "lgx":
121121
if allele in self._lgx:
122122
return self._lgx[allele]
123123
else:
124-
# for 'lgx' when mac_code is not in G group,
125-
# return mac_code with only first 2 field
124+
# for 'lgx' when allele is not in G group,
125+
# return allele with only first 2 field
126126
return ':'.join(allele.split(':')[0:2])
127127
else:
128128
if self._remove_invalid:

0 commit comments

Comments
 (0)