Skip to content
Snippets Groups Projects
Commit 919ab7a9 authored by nfontrod's avatar nfontrod
Browse files

src/db_utils/populate_database.py: refactoring of 2 lines

parent 0396538f
No related branches found
No related tags found
No related merge requests found
......@@ -43,8 +43,7 @@ def get_number_columns(table: str, cnx: sqlite3.Connection) -> List[str]:
cursor.execute(query)
cols_data = cursor.fetchall()
cursor.close()
col_name = [col[1] for col in cols_data]
return col_name
return [col[1] for col in cols_data]
def check_file(table: str, file: Union[Path, pd.DataFrame],
......@@ -61,10 +60,7 @@ def check_file(table: str, file: Union[Path, pd.DataFrame],
:return: The row in file.
"""
column_names = get_number_columns(table, cnx)
if isinstance(file, Path):
df = pd.read_csv(file, sep="\t")
else:
df = file
df = pd.read_csv(file, sep="\t") if isinstance(file, Path) else file
if len(df.columns) != len(column_names):
msg = "Wrong number of columns"
logging.exception(msg)
......
......@@ -38,8 +38,8 @@ def launcher(weight: List[int] = (1),
"""
if not ConfigGraph.get_hipmcl_prog().is_file():
install_hipmcl("INFO")
multiple_community_launcher(1, weight, global_weight, same_gene, html_fig,
logging_level)
# multiple_community_launcher(1, weight, global_weight, same_gene, html_fig,
# logging_level)
multiple_stat_launcher(ps, weight, global_weight, same_gene,
logging_level)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment