Skip to content
Snippets Groups Projects
Commit bd3d5290 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'mva_flake8' into 'main'

MVAUtils: fix flake8 v7 warnings

See merge request atlas/athena!70982
parents 7ddee017 91f5affa
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
__doc__ = "Convert XGBoost model to TTree to be used with MVAUtils."
__author__ = "Yuan-Tang Chou"
......@@ -49,9 +49,9 @@ class XBGoostTextNode(dict):
else: # XGBoost "NO" is right branch in MVAUtils
return XBGoostTextNode(self['children'][self.get_nodeid('no')])
def get_nodeid(self, type):
def get_nodeid(self, node_type):
for idx, children in enumerate(self['children']):
if children['nodeid'] == self[type]:
if children['nodeid'] == self[node_type]:
return idx
def get_default_left(self):
......@@ -283,7 +283,7 @@ def check_file(fn):
logging.info("file %s is empty", fn)
return False
tree = f.Get(keys[0].GetName())
if type(tree) != ROOT.TTree:
if type(tree) is not ROOT.TTree:
logging.info("cannot find TTree in file %s", fn)
return False
if not tree.GetEntries():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment