From 3a1c70bdab518db0872a2f8001ca98a78938c4eb Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Mon, 2 Nov 2020 11:51:14 +0100
Subject: [PATCH] AtlasGeoModel: enable flake8 and fix/remove code

Enable `flake8` and make code compliant. Delete all obsolete job option
fragments in `share/`.
---
 .../GeoModel/AtlasGeoModel/CMakeLists.txt     |  9 ++----
 .../GeoModel/AtlasGeoModel/python/Agdd2Geo.py |  8 ++---
 .../python/AtlasGeoDBInterface.py             | 10 +++---
 .../AtlasGeoModel/python/GeoModelInit.py      | 18 +++++------
 .../AtlasGeoModel/python/GeoModelInitCTB.py   |  9 +++---
 .../AtlasGeoModel/python/GeoModelInitDC1.py   |  6 ++--
 .../AtlasGeoModel/python/GeoModelInitH6.py    |  4 +--
 .../python/GeoModelInitStandard.py            | 15 ++++-----
 .../GeoModel/AtlasGeoModel/python/InDetGM.py  | 14 ++------
 .../python/InDetGMJobProperties.py            | 32 +++++++++----------
 .../GeoModel/AtlasGeoModel/python/LArGM.py    |  6 ++--
 .../python/MuonGMJobProperties.py             |  6 ++--
 .../python/SetGeometryVersion.py              |  4 +--
 .../AtlasGeoModel/python/SetupRecoGeometry.py |  4 +--
 .../AtlasGeoModel/share/GeoModelBuildAll.py   |  6 ----
 .../AtlasGeoModel/share/GeoModelCommon.py     |  6 ----
 .../AtlasGeoModel/share/GeoModelInit.py       |  4 ---
 .../AtlasGeoModel/share/GeoModelInitCTB.py    |  4 ---
 .../AtlasGeoModel/share/GeoModelInitDC1.py    |  4 ---
 .../AtlasGeoModel/share/GeoModelInitH6.py     |  4 ---
 .../share/GeoModelInitStandard.py             |  5 ---
 .../AtlasGeoModel/share/InDetGeoModel.py      |  5 ---
 .../AtlasGeoModel/share/InDetGeoModelCTB.py   |  7 ----
 .../AtlasGeoModel/share/InDetGeoModelDC2.py   |  5 ---
 .../AtlasGeoModel/share/LArGeoModel.py        |  2 --
 .../AtlasGeoModel/share/MiscGeoModel.py       |  4 ---
 .../AtlasGeoModel/share/MuonGeoModel.py       |  4 ---
 .../AtlasGeoModel/share/MuonGeoModelCTB.py    |  2 --
 .../AtlasGeoModel/share/SetGeometryVersion.py |  5 ---
 .../share/SetGeometryVersionNew.py            |  6 ----
 .../AtlasGeoModel/share/TileGeoModel.py       |  4 ---
 .../AtlasGeoModel/share/TileGeoModelCTB.py    |  6 ----
 .../test/AtlasGeometryConfig_AOD_test.py      |  3 +-
 .../test/AtlasGeometryConfig_EVNT_test.py     |  3 +-
 .../test/AtlasGeometryConfig_HITS_test.py     |  3 +-
 35 files changed, 68 insertions(+), 169 deletions(-)
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelBuildAll.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelCommon.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInit.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitCTB.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitDC1.py
 delete mode 100644 DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitH6.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitStandard.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModel.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModelCTB.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModelDC2.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/LArGeoModel.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/MiscGeoModel.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/MuonGeoModel.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/MuonGeoModelCTB.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/SetGeometryVersion.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/SetGeometryVersionNew.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/TileGeoModel.py
 delete mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/share/TileGeoModelCTB.py

diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/CMakeLists.txt b/DetectorDescription/GeoModel/AtlasGeoModel/CMakeLists.txt
index 2f77ee8ad5a..3f0edb1092b 100644
--- a/DetectorDescription/GeoModel/AtlasGeoModel/CMakeLists.txt
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/CMakeLists.txt
@@ -1,14 +1,11 @@
-################################################################################
-# Package: AtlasGeoModel
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( AtlasGeoModel )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
-atlas_install_joboptions( share/*.py )
-atlas_install_scripts( test/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
+atlas_install_scripts( test/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 
 if( NOT GENERATIONBASE )
   atlas_add_test( EVNT_InputGeo_test
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/Agdd2Geo.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/Agdd2Geo.py
index 581c3601798..b30e1815a55 100644
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/Agdd2Geo.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/Agdd2Geo.py
@@ -1,20 +1,20 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.DetFlags import DetFlags
 from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
 
 if ( DetFlags.detdescr.Muon_on() ):
     from AthenaCommon import CfgGetter
-    from AthenaCommon.AppMgr import ToolSvc,ServiceMgr,theApp
+    from AthenaCommon.AppMgr import ServiceMgr,theApp
 
     from AGDD2GeoSvc.AGDD2GeoSvcConf import AGDDtoGeoSvc
     AGDD2Geo = AGDDtoGeoSvc()
 
-    if not "MuonAGDDTool/MuonSpectrometer" in AGDD2Geo.Builders.__str__():
+    if "MuonAGDDTool/MuonSpectrometer" not in AGDD2Geo.Builders.__str__():
         AGDD2Geo.Builders += [CfgGetter.getPrivateTool("MuonSpectrometer", checkType=True)]
 
     if (MuonGeometryFlags.hasSTGC() and MuonGeometryFlags.hasMM()):
-        if not "NSWAGDDTool/NewSmallWheel" in AGDD2Geo.Builders.__str__():
+        if "NSWAGDDTool/NewSmallWheel" not in AGDD2Geo.Builders.__str__():
             AGDD2Geo.Builders += [CfgGetter.getPrivateTool("NewSmallWheel", checkType=True)]
 
     theApp.CreateSvc += ["AGDDtoGeoSvc"]
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/AtlasGeoDBInterface.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/AtlasGeoDBInterface.py
index be5826fefe8..52a73c8ecb1 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/AtlasGeoDBInterface.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/AtlasGeoDBInterface.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon import Logging
 
@@ -126,10 +126,10 @@ class AtlasGeoDBInterface:
 
         # Check if the geometry tag was found in the DB
         if self.dbGeoTagId=="":
-            Logging.log.error("The geometry tag "+self.dbGeoTag+" could not be found in the database.")
+            Logging.log.error("The geometry tag %s could not be found in the database.", self.dbGeoTag)
             Logging.log.error("Its name might be misspelled and/or the script might access a local DB that is not up to date.")
             import sys
-            sys.exit();
+            sys.exit()
 
         # Get node ids for the geometry tag
         tagIdList=[int(self.dbGeoTagId)]    # start with the geometry tag Id
@@ -137,7 +137,7 @@ class AtlasGeoDBInterface:
         # Loop while child tags are found
         while not bStopLoop :
 
-            query0 = self.dbSchema.newQuery();
+            query0 = self.dbSchema.newQuery()
 
             query0.addToOutputList('C.NODE_NAME',"nodename")
             query0.addToOutputList('A.TAG_NAME',"tagname")
@@ -177,7 +177,7 @@ class AtlasGeoDBInterface:
         upLeafName=leafName.upper()
 
         # check if table is defined in the current geometry
-        if not leafName in self.TagAndNodeVersionDict:
+        if leafName not in self.TagAndNodeVersionDict:
             dbId=[]
             dbContent={}
             paramName=[]
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInit.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInit.py
index 8b1d7599900..1c3f95c46ac 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInit.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInit.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 ## @file: AtlasGeoModel/python/GeoModelInit.py
 ## @brief: Encapsulate GeoModel configuration
@@ -13,24 +13,24 @@ def _setupGeoModel():
             import DetDescrCnvSvc.DetStoreConfig
             svcMgr.DetDescrCnvSvc.IdDictFromRDB = True
     except ImportError:
-        import DetDescrCnvSvc.DetStoreConfig
+        import DetDescrCnvSvc.DetStoreConfig  # noqa: F401
         svcMgr.DetDescrCnvSvc.IdDictFromRDB = True
 
     # Conditions DB setup and TagInfo
-    from IOVDbSvc.CondDB import conddb
-    import EventInfoMgt.EventInfoMgtInit
+    from IOVDbSvc.CondDB import conddb    # noqa: F401
+    import EventInfoMgt.EventInfoMgtInit  # noqa: F401
  
     if ( jobproperties.Global.DataSource() == "geant3" ):
-        from AtlasGeoModel import GeoModelInitDC1
- 
+        from AtlasGeoModel import GeoModelInitDC1  # noqa: F401
+
     elif ( jobproperties.Global.DetGeo() == "ctbh8" ):
-        from AtlasGeoModel import GeoModelInitCTB
+        from AtlasGeoModel import GeoModelInitCTB  # noqa: F401
  
     elif ( jobproperties.Global.DetGeo() == "ctbh6" ):
-        from AtlasGeoModel import GeoModelInitH6
+        from AtlasGeoModel import GeoModelInitH6   # noqa: F401
  
     else:
-        from AtlasGeoModel import GeoModelInitStandard
+        from AtlasGeoModel import GeoModelInitStandard  # noqa: F401
 
     pass
 
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitCTB.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitCTB.py
index ea3c08786ab..306df1243fa 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitCTB.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitCTB.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.AppMgr import ServiceMgr
 from AthenaCommon.AppMgr import theApp
@@ -7,7 +7,6 @@ from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
 ServiceMgr += GeoModelSvc()
 theApp.CreateSvc += [ "GeoModelSvc"]
 
-from AtlasGeoModel import InDetGMCTB
-from AtlasGeoModel import TileGMCTB
-from AtlasGeoModel import LArGM
-
+from AtlasGeoModel import InDetGMCTB  # noqa: F401
+from AtlasGeoModel import TileGMCTB   # noqa: F401
+from AtlasGeoModel import LArGM       # noqa: F401
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitDC1.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitDC1.py
index e8cc3988626..f3fcc9ccb17 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitDC1.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitDC1.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.AppMgr import ServiceMgr
 from AthenaCommon.AppMgr import theApp
@@ -7,5 +7,5 @@ from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
 ServiceMgr += GeoModelSvc()
 theApp.CreateSvc += [ "GeoModelSvc"]
 
-from AtlasGeoModel import InDetGM
-from AtlasGeoModel import MuonGM
+from AtlasGeoModel import InDetGM  # noqa: F401
+from AtlasGeoModel import MuonGM   # noqa: F401
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitH6.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitH6.py
index 48d01951329..c9bda3fd87c 100644
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitH6.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitH6.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.AppMgr import ServiceMgr
 from AthenaCommon.AppMgr import theApp
@@ -35,4 +35,4 @@ elif (SimFlags.SimLayout.get_Value()=="tb_LArH6_2004"):
 
 
 # as long as not created anywhere else in GeoModel :
-from CaloDetMgrDetDescrCnv import CaloDetMgrDDCnv
+from CaloDetMgrDetDescrCnv import CaloDetMgrDDCnv  # noqa: F401
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitStandard.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitStandard.py
index 9bd604af9af..e9e9279bb1b 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitStandard.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInitStandard.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.AppMgr import ServiceMgr
 from AthenaCommon.AppMgr import theApp
@@ -8,10 +8,9 @@ ServiceMgr += GeoModelSvc()
 theApp.CreateSvc += [ "GeoModelSvc"]
 
 # Load the detectors. These job option fragments look at DetFlags 
-from AtlasGeoModel import InDetGM
-from AtlasGeoModel import LArGM
-from AtlasGeoModel import TileGM
-from AtlasGeoModel import MuonGM
-from AtlasGeoModel import ForDetGM
-from AtlasGeoModel import MiscGM
-
+from AtlasGeoModel import InDetGM   # noqa: F401
+from AtlasGeoModel import LArGM     # noqa: F401
+from AtlasGeoModel import TileGM    # noqa: F401
+from AtlasGeoModel import MuonGM    # noqa: F401
+from AtlasGeoModel import ForDetGM  # noqa: F401
+from AtlasGeoModel import MiscGM    # noqa: F401
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py
index 7f1952dc4e1..a2d8e46b004 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py
@@ -1,22 +1,18 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 #
 # InDet GeoModel initialization
 #
-from AthenaCommon.GlobalFlags import globalflags
 from AthenaCommon.JobProperties import jobproperties
 from AthenaCommon.DetFlags      import DetFlags
 from AthenaCommon.AppMgr        import ServiceMgr as svcMgr
 
 from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags
 from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags
-if InDetGeometryFlags.isSLHC():
-    #SLHC specific code
-    from AthenaCommon.AppMgr import ToolSvc
 
 # Treat CTB separately
 if ( jobproperties.Global.DetGeo() == "ctbh8" or jobproperties.Global.DetGeo() == "ctbh6" ):
-    from AtlasGeoModel import InDetGMCTB
+    from AtlasGeoModel import InDetGMCTB  # noqa: F401
 
 elif ( DetFlags.detdescr.ID_on() ):
     from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
@@ -31,7 +27,6 @@ elif ( DetFlags.detdescr.ID_on() ):
         GeoModelSvc.DetectorTools += [ CfgGetter.getPrivateTool("PixelDetectorTool", checkType=True) ]
 
         if (DetFlags.detdescr.BCM_on() ) :
-            from AthenaCommon.AppMgr import ToolSvc
             from BCM_GeoModel.BCM_GeoModelConf import InDetDD__BCM_Builder
             bcmTool = InDetDD__BCM_Builder()
             GeoModelSvc.DetectorTools['PixelDetectorTool'].BCM_Tool = bcmTool
@@ -51,7 +46,6 @@ elif ( DetFlags.detdescr.ID_on() ):
             else:
                 from SCT_SLHC_GeoModel.SCT_SLHC_GeoModelConf import SCT_SLHC_DetectorTool
                 sctSLHCTool = SCT_SLHC_DetectorTool()
-                sctSLHCTool.ServiceBuilderTool = InDetServMatBuilderToolSLHC
             GeoModelSvc.DetectorTools += [ sctSLHCTool ]
         else:
             # Current atlas specific code
@@ -71,10 +65,8 @@ elif ( DetFlags.detdescr.ID_on() ):
         #SLHC specific code
         servMatTool = InDetServMatTool()
         GeoModelSvc.DetectorTools += [ servMatTool ]
-        servMatTool.ServiceBuilderTool = InDetServMatBuilderToolSLHC
     else:
         GeoModelSvc.DetectorTools += [ InDetServMatTool() ]
 
     # Make alignable
-    from InDetCondFolders import InDetAlignFolders
-
+    from InDetCondFolders import InDetAlignFolders  # noqa: F401
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMJobProperties.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMJobProperties.py
index 43c5b63cf21..5744bd0b379 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMJobProperties.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMJobProperties.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 #
 # InDet GeoModel initialization
@@ -70,21 +70,21 @@ class InDetGMFlags(CommonGMFlags, object):
         self.__dict__["IBL"] = False
         self.__dict__["SLHC"] = False
         if _layout in ['IBL'] : self.__dict__["IBL"] = True
-        if self.__dict__["IBL"] == False: self.__dict__["IBLlayout"]="noIBL"
+        if self.__dict__["IBL"] is False: self.__dict__["IBLlayout"]="noIBL"
         if _layout not in ['SLHC'] and ( CommonGeometryFlags.Run() in ["RUN2", "RUN3"] ) : self.__dict__["IBL"] = True
         if _layout in ['SLHC'] : self.__dict__["SLHC"] = True
 
 
     def dump(self):
 
-        Logging.log.info("Geometry tag InDetGMFlags : "+self.__dict__["geomTag"]+" ------------------------------------")
-        Logging.log.info("VersionName = "+self.__dict__["VersionName"])
-        Logging.log.info("Layout      = "+self.__dict__["Layout"])
-        Logging.log.info("DBM         = "+self.__dict__["DBM"])
+        Logging.log.info("Geometry tag InDetGMFlags : %s", self.__dict__["geomTag"]+" ------------------------------------")
+        Logging.log.info("VersionName = %s", self.__dict__["VersionName"])
+        Logging.log.info("Layout      = %s", self.__dict__["Layout"])
+        Logging.log.info("DBM         = %s", self.__dict__["DBM"])
 
-        Logging.log.info("SLHC flag : "+self.__dict__["SLHC"])
-        Logging.log.info("IBL flag   : "+self.__dict__["IBL"])
-        Logging.log.info("IBL layout : "+ self.__dict__["IBLlayout"])
+        Logging.log.info("SLHC flag : %s", self.__dict__["SLHC"])
+        Logging.log.info("IBL flag   : %s", self.__dict__["IBL"])
+        Logging.log.info("IBL layout : %s", self.__dict__["IBLlayout"])
 
 
 # -------------------------------------------------------------------------------------
@@ -169,14 +169,14 @@ class InDetGeometryFlags_JobProperties(JobPropertyContainer):
 
     def dump(self):
 
-        Logging.log.info("VersionName = "+self.GeoVersionName())
-        Logging.log.info("Layout      = "+self.GeoLayout())
-        Logging.log.info("DBM         = "+self.isDBM())
+        Logging.log.info("VersionName = %s", self.GeoVersionName())
+        Logging.log.info("Layout      = %s", self.GeoLayout())
+        Logging.log.info("DBM         = %s", self.isDBM())
 
-        Logging.log.info("SLHC flag : "+self.isSLHC())
-        Logging.log.info("IBL flag   : "+self.isIBL())
-        Logging.log.info("IBL layout : "+self.IBLLayout())
-        Logging.log.info("Dynamic alignment : "+self.useDynamicAlignFolders())
+        Logging.log.info("SLHC flag : %s", self.isSLHC())
+        Logging.log.info("IBL flag   : %s", self.isIBL())
+        Logging.log.info("IBL layout : %s", self.IBLLayout())
+        Logging.log.info("Dynamic alignment : %s", self.useDynamicAlignFolders())
 
 
 jobproperties.add_Container(InDetGeometryFlags_JobProperties)
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/LArGM.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/LArGM.py
index e1356826b36..b184c5fd6b2 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/LArGM.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/LArGM.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 #
 # LAr GeoModel initialization
@@ -13,10 +13,10 @@ if ( DetFlags.detdescr.LAr_on() ):
     GeoModelSvc.DetectorTools += [ LArDetectorToolNV() ]
 
     # as long as not created anywhere else in GeoModel :
-    from CaloDetMgrDetDescrCnv import CaloDetMgrDDCnv
+    from CaloDetMgrDetDescrCnv import CaloDetMgrDDCnv  # noqa: F401
 
     # apply possible alignments
     if ( jobproperties.Global.DetGeo() == "atlas" or
          jobproperties.Global.DetGeo() == "commis" ):
-        from LArConditionsCommon import LArAlignable
+        from LArConditionsCommon import LArAlignable  # noqa: F401
         GeoModelSvc.DetectorTools[ "LArDetectorToolNV" ].ApplyAlignments = True
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGMJobProperties.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGMJobProperties.py
index 48aff257792..9e732883405 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGMJobProperties.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGMJobProperties.py
@@ -1,9 +1,7 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from __future__ import print_function
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from AtlasGeoModel.CommonGMJobProperties import CommonGMFlags, CommonGeometryFlags
+from AtlasGeoModel.CommonGMJobProperties import CommonGMFlags
 
 # -------------------------------------------------------------------------------------
 #  Muon geometry flags initialization
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/SetGeometryVersion.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/SetGeometryVersion.py
index 3e282c80f53..f4d98482af2 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/SetGeometryVersion.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/SetGeometryVersion.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.JobProperties import jobproperties
 from AthenaCommon.DetFlags    import DetFlags
@@ -56,5 +56,5 @@ relversion = rel_metadata['release'].split('.')
 if len(relversion) < 3:
     relversion = rel_metadata['base release'].split('.')
 
-Logging.log.info("SetGeometryVersion.py obtained major release version %s" % relversion[0])
+Logging.log.info("SetGeometryVersion.py obtained major release version %s", relversion[0])
 GeoModelSvc.SupportedGeometry = int(relversion[0])
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/SetupRecoGeometry.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/SetupRecoGeometry.py
index 4c5de86c63c..da80c361475 100644
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/SetupRecoGeometry.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/SetupRecoGeometry.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 #
 # Configure GeoModel tools to build minimal geometry fo reconstruction
@@ -19,4 +19,4 @@ if ( DetFlags.detdescr.Tile_on() ):
 # Build Muon dead materials using AGDD2Geo
 #
 
-from AtlasGeoModel import Agdd2Geo
+from AtlasGeoModel import Agdd2Geo  # noqa: F401
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelBuildAll.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelBuildAll.py
deleted file mode 100755
index 750b4dcb3fa..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelBuildAll.py
+++ /dev/null
@@ -1,6 +0,0 @@
-
-print "AtlasGeoModel/GeoModelBuildAll.py is OBSOLETE"
-
-from AtlasGeoModel import SetGeometryVersion
-from AtlasGeoModel import GeoModelInit
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelCommon.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelCommon.py
deleted file mode 100755
index c99b7cd3820..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelCommon.py
+++ /dev/null
@@ -1,6 +0,0 @@
-
-print "AtlasGeoModel/GeoModelCommon.py is OBSOLETE"
-
-from AtlasGeoModel import SetGeometryVersion
-from AtlasGeoModel import GeoModelInit
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInit.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInit.py
deleted file mode 100755
index af3f02e4cf8..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInit.py
+++ /dev/null
@@ -1,4 +0,0 @@
-
-printfunc ("AtlasGeoModel/GeoModelInit.py is OBSOLETE")
-
-from AtlasGeoModel import GeoModelInit
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitCTB.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitCTB.py
deleted file mode 100755
index 116fc9ce10f..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitCTB.py
+++ /dev/null
@@ -1,4 +0,0 @@
-print "AtlasGeoModel/GeoModelInitCTB.py is OBSOLETE"
-
-from AtlasGeoModel import GeoModelInitCTB
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitDC1.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitDC1.py
deleted file mode 100755
index 34c62664445..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitDC1.py
+++ /dev/null
@@ -1,4 +0,0 @@
-print "AtlasGeoModel/GeoModelInitDC1.py is OBSOLETE"
-
-from AtlasGeoModel import GeoModelInitDC1
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitH6.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitH6.py
deleted file mode 100644
index ca5fca55679..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitH6.py
+++ /dev/null
@@ -1,4 +0,0 @@
-print "AtlasGeoModel/GeoModelInitH6.py is OBSOLETE"
-
-from AtlasGeoModel import GeoModelInitH6
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitStandard.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitStandard.py
deleted file mode 100755
index 3d15de2aeb3..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/GeoModelInitStandard.py
+++ /dev/null
@@ -1,5 +0,0 @@
-
-print "AtlasGeoModel/GeoModelInitStandard.py is OBSOLETE"
-
-from AtlasGeoModel import GeoModelInitStandard
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModel.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModel.py
deleted file mode 100755
index 3cd0c897446..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModel.py
+++ /dev/null
@@ -1,5 +0,0 @@
-
-print "AtlasGeoModel/InDetGeoModel.py is OBSOLETE"
-
-from AtlasGeoModel import InDetGM
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModelCTB.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModelCTB.py
deleted file mode 100755
index 173c59dac77..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModelCTB.py
+++ /dev/null
@@ -1,7 +0,0 @@
-
-print "AtlasGeoModel/InDetGeoModelCTB.py is OBSOLETE"
-
-from AtlasGeoModel import InDetGMCTB
-
-
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModelDC2.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModelDC2.py
deleted file mode 100755
index 5f043fb4571..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/InDetGeoModelDC2.py
+++ /dev/null
@@ -1,5 +0,0 @@
-
-print "AtlasGeoModel/InDetGeoModelDC2.py is OBSOLETE"
-
-from AtlasGeoModel import InDetGM
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/LArGeoModel.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/LArGeoModel.py
deleted file mode 100755
index 29a4b456351..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/LArGeoModel.py
+++ /dev/null
@@ -1,2 +0,0 @@
-from AtlasGeoModel import LArGM
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/MiscGeoModel.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/MiscGeoModel.py
deleted file mode 100755
index a57eb05c77e..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/MiscGeoModel.py
+++ /dev/null
@@ -1,4 +0,0 @@
-
-print "AtlasGeoModel/MiscGeoModel.py is OBSOLETE"
-
-from AtlasGeoModel import MiscGM
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/MuonGeoModel.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/MuonGeoModel.py
deleted file mode 100755
index f0b394a4947..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/MuonGeoModel.py
+++ /dev/null
@@ -1,4 +0,0 @@
-
-print "AtlasGeoModel/MuonGeoModel.py is OBSOLETE"
-
-from AtlasGeoModel import MuonGM
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/MuonGeoModelCTB.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/MuonGeoModelCTB.py
deleted file mode 100755
index 0f5d97372a4..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/MuonGeoModelCTB.py
+++ /dev/null
@@ -1,2 +0,0 @@
-print " MuonGeoModelCTB is not supported "
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/SetGeometryVersion.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/SetGeometryVersion.py
deleted file mode 100755
index c5ef0cad550..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/SetGeometryVersion.py
+++ /dev/null
@@ -1,5 +0,0 @@
-
-printfunc ("AtlasGeoModel/SetGeometryVersion.py is OBSOLETE")
-
-from AtlasGeoModel import SetGeometryVersion
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/SetGeometryVersionNew.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/SetGeometryVersionNew.py
deleted file mode 100755
index 1e0eb7f3044..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/SetGeometryVersionNew.py
+++ /dev/null
@@ -1,6 +0,0 @@
-
-print "AtlasGeoModel/SetGeometryVersionNew.py is OBSOLETE"
-
-from AtlasGeoModel import SetGeometryVersion
-      
-   
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/TileGeoModel.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/TileGeoModel.py
deleted file mode 100755
index bbbe0de6cab..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/TileGeoModel.py
+++ /dev/null
@@ -1,4 +0,0 @@
-
-print "AtlasGeoModel/TileGeoModel.py is OBSOLETE"
-
-from AtlasGeoModel import TileGM   
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/share/TileGeoModelCTB.py b/DetectorDescription/GeoModel/AtlasGeoModel/share/TileGeoModelCTB.py
deleted file mode 100755
index 33a6e3df95f..00000000000
--- a/DetectorDescription/GeoModel/AtlasGeoModel/share/TileGeoModelCTB.py
+++ /dev/null
@@ -1,6 +0,0 @@
-
-print "AtlasGeoModel/TileGeoModelCTB.py is OBSOLETE"
-
-from AtlasGeoModel import TileGMCTB
-
-
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_AOD_test.py b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_AOD_test.py
index baeaf75e861..6c0cace9af8 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_AOD_test.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_AOD_test.py
@@ -1,10 +1,9 @@
 #!/usr/bin/env python
 """Run a test on Atlas Geometry configuration using a HITS file as input
 
-Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 """
 if __name__ == "__main__":
-    import os
     from AthenaCommon.Logging import log
     from AthenaCommon.Constants import DEBUG
     from AthenaCommon.Configurable import Configurable
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_EVNT_test.py b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_EVNT_test.py
index 96e2f53e8cd..431daabf194 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_EVNT_test.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_EVNT_test.py
@@ -1,10 +1,9 @@
 #!/usr/bin/env python
 """Run a test on Atlas Geometry configuration using a EVNT file as input
 
-Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 """
 if __name__ == "__main__":
-    import os
     from AthenaCommon.Logging import log
     from AthenaCommon.Constants import DEBUG
     from AthenaCommon.Configurable import Configurable
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_HITS_test.py b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_HITS_test.py
index e6d7ec29305..b1f721b81d4 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_HITS_test.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_HITS_test.py
@@ -1,10 +1,9 @@
 #!/usr/bin/env python
 """Run a test on Atlas Geometry configuration using a HITS file as input
 
-Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 """
 if __name__ == "__main__":
-    import os
     from AthenaCommon.Logging import log
     from AthenaCommon.Constants import DEBUG
     from AthenaCommon.Configurable import Configurable
-- 
GitLab