From d1d433e867228603fab516eade8dc884eca63138 Mon Sep 17 00:00:00 2001 From: Frank Winklmeier <fwinkl@cern> Date: Thu, 3 Dec 2020 12:51:26 +0100 Subject: [PATCH] FastCaloSim: enable flake8 and fix code Make code flake8 compliant. Delete unused and broken `getFastShowerCellBuilderTool` method. --- Simulation/FastShower/FastCaloSim/CMakeLists.txt | 2 +- .../FastCaloSim/python/FastCaloSimFactory.py | 12 +----------- .../FastCaloSim/python/JetRec_FastCaloSim.py | 4 +--- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Simulation/FastShower/FastCaloSim/CMakeLists.txt b/Simulation/FastShower/FastCaloSim/CMakeLists.txt index f11b4f864f8e..ef97bdd2e0bd 100644 --- a/Simulation/FastShower/FastCaloSim/CMakeLists.txt +++ b/Simulation/FastShower/FastCaloSim/CMakeLists.txt @@ -54,7 +54,7 @@ atlas_add_component( FastCaloSim LINK_LIBRARIES FastCaloSimLib ) # Install files from the package: -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) atlas_add_test( FastShowerCellBuilderTool_test diff --git a/Simulation/FastShower/FastCaloSim/python/FastCaloSimFactory.py b/Simulation/FastShower/FastCaloSim/python/FastCaloSimFactory.py index f6b8a8a5332e..f4151b25110d 100644 --- a/Simulation/FastShower/FastCaloSim/python/FastCaloSimFactory.py +++ b/Simulation/FastShower/FastCaloSim/python/FastCaloSimFactory.py @@ -1,14 +1,10 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -from AthenaCommon.Constants import * -from RecExConfig.Configured import Configured - def FastCaloSimFactory(name="FastCaloSimFactory", **kwargs): from AthenaCommon.Logging import logging mlog = logging.getLogger( 'FastCaloSimFactory::configure:' ) - from CaloRec.CaloCellFlags import jobproperties from AthenaCommon.AppMgr import ToolSvc ######################################################################################################### @@ -45,11 +41,10 @@ def FastCaloSimFactory(name="FastCaloSimFactory", **kwargs): #theFastShowerCellBuilderTool.Invisibles=[12, 14, 16, 1000022] ######################################################################################################### - import os try: ParticleParametrizationFileName=theFastShowerCellBuilderTool.ParticleParametrizationFileName - except: + except Exception: ParticleParametrizationFileName="" if ParticleParametrizationFileName=="" and len(theFastShowerCellBuilderTool.AdditionalParticleParametrizationFileNames)==0: @@ -66,8 +61,3 @@ def FastCaloSimFactory(name="FastCaloSimFactory", **kwargs): mlog.info (theFastShowerCellBuilderTool) return theFastShowerCellBuilderTool - -def getFastShowerCellBuilderTool(name="FastShowerCellBuilderTool", **kwargs): - - return FastShowerCellBuilderTool() - diff --git a/Simulation/FastShower/FastCaloSim/python/JetRec_FastCaloSim.py b/Simulation/FastShower/FastCaloSim/python/JetRec_FastCaloSim.py index 1237d101518e..ea35841d45dd 100755 --- a/Simulation/FastShower/FastCaloSim/python/JetRec_FastCaloSim.py +++ b/Simulation/FastShower/FastCaloSim/python/JetRec_FastCaloSim.py @@ -1,8 +1,6 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - - -from JetRec.JetGetters import * +from JetRec.JetGetters import make_StandardJetGetter from JetRec.JetRecFlags import jetFlags def make_FastCaloSimJets(doTowerJet = True, doTopoJet = True, doTruthJet = True, doLocalCalib = False , -- GitLab