From b4469b71da13c3b7b85e5e1303c4cae8fd3df30a Mon Sep 17 00:00:00 2001 From: OlivieFranklova Date: Wed, 2 Oct 2024 15:28:05 +0200 Subject: [PATCH] omit some similarityRunner files --- .github/workflows/py_test.yml | 2 +- .../{functionsRunner.py => functions_runner.py} | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) rename similarityRunner/{functionsRunner.py => functions_runner.py} (65%) diff --git a/.github/workflows/py_test.yml b/.github/workflows/py_test.yml index fee1298..ce4896d 100644 --- a/.github/workflows/py_test.yml +++ b/.github/workflows/py_test.yml @@ -75,7 +75,7 @@ jobs: pytest $TEST_FILES - name: Show coverage - run: coverage report -m --omit=[".*.ipynb", "similarityRunner/UI", "similarityRunner/models", "similarityRunner/runner.py"] + run: coverage report -m --omit=".*.ipynb,similarityRunner/UI/*,*[U|u]ser*,similarityRunner/runner.py" - name: Create coverage file if: github.event_name == 'pull_request' diff --git a/similarityRunner/functionsRunner.py b/similarityRunner/functions_runner.py similarity index 65% rename from similarityRunner/functionsRunner.py rename to similarityRunner/functions_runner.py index c6bc1a8..a3ba948 100644 --- a/similarityRunner/functionsRunner.py +++ b/similarityRunner/functions_runner.py @@ -1,10 +1,18 @@ +""" +This file contains functions used in the similarityRunner package. +""" import pandas as pd from models.connector_models import FileType def load_files_from_list(folder: list[str], file_types: tuple = (FileType.CSV,)) -> tuple[list[pd.DataFrame], list[str]]: - """ """ + """ + Load files from a list of files + :param folder: list of files to load + :param file_types: tuple of posible file types + :return: tuple of data list and names list + """ data = [] names = [] for file in folder: @@ -17,7 +25,11 @@ def load_files_from_list(folder: list[str], file_types: tuple = (FileType.CSV,)) return data, names -def csv_to_parquet(file: str): +def csv_to_parquet(file: str) -> str: + """ + Convert csv file to parquet + :param file: file to convert + """ df = pd.read_csv(file) df.to_parquet(file.replace(".csv", ".parquet")) return file.replace(".csv", ".parquet")