From b7942002b2f40af965bd0ef9c9673fbaeb28a9e1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 15 Jan 2024 18:40:20 +0300 Subject: Update imports: `take` was moved to different package. --- qc_app/samples.py | 2 +- quality_control/parsing.py | 4 +--- scripts/insert_data.py | 3 ++- scripts/qc.py | 8 +++----- scripts/rqtl2/install_genotypes.py | 2 +- scripts/rqtl2/install_phenos.py | 2 +- tests/qc/test_error_collection.py | 3 ++- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/qc_app/samples.py b/qc_app/samples.py index 8f56ee1..bf33715 100644 --- a/qc_app/samples.py +++ b/qc_app/samples.py @@ -18,7 +18,7 @@ from flask import ( render_template, current_app as app) -from quality_control.parsing import take +from functional_tools import take from qc_app import jobs from qc_app.files import save_file diff --git a/quality_control/parsing.py b/quality_control/parsing.py index 5b21716..c545937 100644 --- a/quality_control/parsing.py +++ b/quality_control/parsing.py @@ -2,7 +2,7 @@ import collections from enum import Enum from functools import partial -from typing import Tuple, Union, Iterable, Generator, Callable, Optional +from typing import Tuple, Union, Generator, Callable, Optional import quality_control.average as avg from quality_control.file_utils import open_file @@ -12,8 +12,6 @@ from quality_control.errors import ( from quality_control.headers import ( invalid_header, invalid_headings, duplicate_headings) -from functional_tools import take - class FileType(Enum): """Enumerate the expected file types""" AVERAGE = 1 diff --git a/scripts/insert_data.py b/scripts/insert_data.py index 0ac3799..72fc897 100644 --- a/scripts/insert_data.py +++ b/scripts/insert_data.py @@ -11,7 +11,8 @@ import MySQLdb as mdb from redis import Redis from MySQLdb.cursors import DictCursor -from quality_control.parsing import take +from functional_tools import take + from quality_control.file_utils import open_file from qc_app.db_utils import database_connection from qc_app.check_connections import check_db, check_redis diff --git a/scripts/qc.py b/scripts/qc.py index 2057cd6..7d41d6c 100644 --- a/scripts/qc.py +++ b/scripts/qc.py @@ -5,13 +5,11 @@ import argparse import mimetypes from typing import Union, Callable +from functional_tools import take + from quality_control.utils import make_progress_calculator from quality_control.errors import InvalidValue, DuplicateHeading -from quality_control.parsing import ( - take, - FileType, - strain_names, - collect_errors) +from quality_control.parsing import FileType, strain_names, collect_errors def is_file_mime(filepath:str, mimetype:str) -> bool: diff --git a/scripts/rqtl2/install_genotypes.py b/scripts/rqtl2/install_genotypes.py index 354bff0..77e7163 100644 --- a/scripts/rqtl2/install_genotypes.py +++ b/scripts/rqtl2/install_genotypes.py @@ -12,7 +12,7 @@ from MySQLdb.cursors import DictCursor from r_qtl import r_qtl2 as rqtl2 -from quality_control.parsing import take +from functional_tools import take from scripts.rqtl2.entry import build_main from scripts.cli_parser import init_cli_parser diff --git a/scripts/rqtl2/install_phenos.py b/scripts/rqtl2/install_phenos.py index b3d445b..4fdf428 100644 --- a/scripts/rqtl2/install_phenos.py +++ b/scripts/rqtl2/install_phenos.py @@ -15,7 +15,7 @@ from scripts.rqtl2.cli_parser import add_common_arguments from r_qtl import r_qtl2 as rqtl2 -from quality_control.parsing import take +from functional_tools import take stderr_handler = logging.StreamHandler(stream=sys.stderr) logger = logging.getLogger("install_phenos") logger.addHandler(stderr_handler) diff --git a/tests/qc/test_error_collection.py b/tests/qc/test_error_collection.py index 25f5d01..962d2c5 100644 --- a/tests/qc/test_error_collection.py +++ b/tests/qc/test_error_collection.py @@ -2,7 +2,8 @@ import pytest -from quality_control.parsing import take, FileType, collect_errors +from functional_tools import take +from quality_control.parsing import FileType, collect_errors from quality_control.errors import ( InvalidValue, DuplicateHeading, InconsistentColumns) -- cgit v1.2.3