From b43cdc92138b465c70d9b8cc0f340e123ce3e4b0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 16:39:00 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- evaluate.py | 1 + src/consensus_utils.py | 16 ++++++++-------- src/models/classifier.py | 12 ++++++------ train.py | 1 + 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/evaluate.py b/evaluate.py index 74402d59..eff36401 100644 --- a/evaluate.py +++ b/evaluate.py @@ -1,6 +1,7 @@ """ Script to evaluate an individual model """ + from openmapflow.config import PROJECT_ROOT, DataPaths from src.pipeline_funcs import run_evaluation # noqa: E402 diff --git a/src/consensus_utils.py b/src/consensus_utils.py index 810a286a..bd8cd9eb 100644 --- a/src/consensus_utils.py +++ b/src/consensus_utils.py @@ -174,10 +174,10 @@ def create_consensus_features(consensus_dataframe: pd.DataFrame) -> pd.DataFrame """Creates and adds features to consensus dataframe.""" # Convert analysis duration to float - consensus_dataframe[ - ["set_1_analysis_duration", "set_2_analysis_duration"] - ] = consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]].applymap( - tofloat + consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]] = ( + consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]].applymap( + tofloat + ) ) # (1) @@ -302,10 +302,10 @@ def renaming_func(s): consensus_dataframe = df1.merge( df2, left_on=["plotid", "sampleid"], right_on=["plotid", "sampleid"] ) - consensus_dataframe[ - ["set_1_analysis_duration", "set_2_analysis_duration"] - ] = consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]].applymap( - tofloat + consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]] = ( + consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]].applymap( + tofloat + ) ) rcolumns = [ diff --git a/src/models/classifier.py b/src/models/classifier.py index 0d0566aa..de7f5cad 100644 --- a/src/models/classifier.py +++ b/src/models/classifier.py @@ -61,9 +61,9 @@ def __init__( global_classification_layers.append( nn.Linear( in_features=hparams.classifier_vector_size, - out_features=1 - if i == (num_global_layers - 1) - else hparams.classifier_vector_size, + out_features=( + 1 if i == (num_global_layers - 1) else hparams.classifier_vector_size + ), bias=True if i == 0 else False, ) ) @@ -82,9 +82,9 @@ def __init__( local_classification_layers.append( nn.Linear( in_features=hparams.classifier_vector_size, - out_features=1 - if i == (num_local_layers - 1) - else hparams.classifier_vector_size, + out_features=( + 1 if i == (num_local_layers - 1) else hparams.classifier_vector_size + ), bias=True if i == 0 else False, ) ) diff --git a/train.py b/train.py index a14c6ee6..5cdf9ddb 100644 --- a/train.py +++ b/train.py @@ -1,6 +1,7 @@ """ Script that uses argument parameters to train an individual model """ + from argparse import ArgumentParser from datasets import datasets