Skip to content

Commit

Permalink
[ANALYSIS] py2/3 compatibility:drop use of __future__
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Nov 22, 2024
1 parent 92333e3 commit 8d027cc
Show file tree
Hide file tree
Showing 108 changed files with 0 additions and 121 deletions.
1 change: 0 additions & 1 deletion DPGAnalysis/SiStripTools/test/MultiplicityMonitor_cfg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
print("MuonAnalysis.MuonAssociators.patMuonsWithTrigger_8E29_cff is deprecated.\nUse use MuonAnalysis.MuonAssociators.patMuonsWithTrigger_cff instead.\n")

from MuonAnalysis.MuonAssociators.patMuonsWithTrigger_cff import *
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import FWCore.ParameterSet.Config as cms

## __ __ _ ____ _ _____ __ __
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/FWLite/scripts/newFWLiteAna.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os
import sys
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/analyzers/core/Analyzer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import os
import logging

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/analyzers/core/AutoHandle.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
#ROOTTOOLS
from DataFormats.FWLite import Events, Handle

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/analyzers/core/EventSelector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from PhysicsTools.HeppyCore.framework.analyzer import Analyzer


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from builtins import range
import itertools

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import itertools

from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer
from PhysicsTools.HeppyCore.statistics.tree import Tree as Tree
from ROOT import TFile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import ROOT

from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import ROOT

from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import copy
from PhysicsTools.HeppyCore.framework.analyzer import Analyzer
from PhysicsTools.Heppy.analyzers.AutoHandle import AutoHandle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
from PhysicsTools.Heppy.analyzers.core.TreeAnalyzerNumpy import TreeAnalyzerNumpy
from . import ntuple

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from PhysicsTools.HeppyCore.framework.analyzer import Analyzer
from PhysicsTools.Heppy.analyzers.AutoHandle import AutoHandle
from PhysicsTools.HeppyCore.statistics.counter import Counter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from PhysicsTools.Heppy.analyzers.DiLeptonAnalyzer import DiLeptonAnalyzer
from PhysicsTools.Heppy.analyzers.AutoHandle import AutoHandle
from PhysicsTools.Heppy.physicsobjects.DiObject import DiElectron
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
from PhysicsTools.Heppy.analyzers.core.TreeAnalyzerNumpy import TreeAnalyzerNumpy
from . import ntuple

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from PhysicsTools.Heppy.analyzers.DiLeptonAnalyzer import DiLeptonAnalyzer
from PhysicsTools.Heppy.analyzers.AutoHandle import AutoHandle
from PhysicsTools.Heppy.physicsobjects.DiObject import DiMuon
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/analyzers/examples/ntuple.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/env python
from __future__ import print_function

def var( tree, varName, type=float ):
tree.var(varName, type)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from builtins import range
from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer
from PhysicsTools.Heppy.analyzers.core.AutoHandle import AutoHandle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import operator
import itertools
import copy
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/analyzers/objects/JetAnalyzer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from builtins import range
import math, os
from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from builtins import range
from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer
from PhysicsTools.Heppy.analyzers.core.AutoHandle import AutoHandle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import operator
import itertools
import copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import itertools

from PhysicsTools.Heppy.analyzers.core.VertexHistograms import VertexHistograms
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/loadlibs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from ROOT import gROOT,gSystem

def load_libs():
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/physicsobjects/Photon.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from PhysicsTools.Heppy.physicsobjects.PhysicsObject import *
from math import exp
import re
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/physicsutils/BTagSF.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
# importing the python binding to the C++ class from ROOT
from ROOT import heppy

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import ROOT
import numpy as np

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/physicsutils/EnergyCorrector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from ROOT import TH1F, TH2F, TFile


Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/physicsutils/JetReCalibrator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from builtins import range
import ROOT
import os, types
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from builtins import range
import ROOT
import math
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/physicsutils/TauDecayModes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function

class TauDecayModes( object ):

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/utils/cmsswPreprocessor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import os
import sys
import re
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/utils/miniAodFiles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from PhysicsTools.Heppy.utils.cmsswRelease import cmsswRelease, releaseNumber

def miniAodFiles():
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/python/utils/rltinfo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from ROOT import TFile
from PhysicsTools.HeppyCore.statistics.tree import Tree as Tree

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/scripts/cmsBatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Colin
# batch mode for cmsRun, March 2009

from __future__ import print_function
from builtins import range
import os, sys, imp, re, pprint, string, time,shutil,copy,pickle,math
from optparse import OptionParser
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/scripts/cmsStageWithFailover.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#this script runs cmsStage multiple times in the case where it failes for some reason

from __future__ import print_function
from builtins import range
if __name__ == '__main__':

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/scripts/heppy_report.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
from __future__ import print_function
from builtins import range
from optparse import OptionParser
import json
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/test/crab/heppy_crab_script.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
from __future__ import print_function
from builtins import range
import os
# probably easier to fetch everything without subdirs, but that's up to user preferences
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/test/example_autofill_multipleTrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# In particular here we create a second tree producer containing only information and then,
# cloning it in two copies, we store it both in the same file as the main tree and in separate file

from __future__ import print_function
import ROOT
import PhysicsTools.HeppyCore.framework.config as cfg
# avoid creating subdirs, in case subdirs are wanted the treeProducer should have different names (set name="blabla" in the config)
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/Heppy/test/simple_example_cfg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import os
import PhysicsTools.HeppyCore.framework.config as cfg
from PhysicsTools.Heppy.utils.miniAodFiles import miniAodFiles
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/analyzers/CMSTestAnalyzer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from PhysicsTools.HeppyCore.framework.analyzer import Analyzer

class CMSTestAnalyzer(Analyzer):
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/analyzers/Printer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from PhysicsTools.HeppyCore.framework.analyzer import Analyzer

class Printer(Analyzer):
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/framework/analyzer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
# Copyright (C) 2014 Colin Bernet
# https://github.com/cbernet/heppy/blob/master/LICENSE

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/framework/chain_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import unittest
import os
import shutil
Expand Down
2 changes: 0 additions & 2 deletions PhysicsTools/HeppyCore/python/framework/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function
from __future__ import absolute_import
# Copyright (C) 2014 Colin Bernet
# https://github.com/cbernet/heppy/blob/master/LICENSE

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/framework/config_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import unittest
import os
import shutil
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/framework/eventsfwlite.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from DataFormats.FWLite import Events as FWLiteEvents

from ROOT import gROOT, gSystem, AutoLibraryLoader
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import unittest

from .eventstfile import Events
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/framework/heppy_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Copyright (C) 2014 Colin Bernet
# https://github.com/cbernet/heppy/blob/master/LICENSE

from __future__ import print_function
from builtins import range
import os
import shutil
Expand Down
2 changes: 0 additions & 2 deletions PhysicsTools/HeppyCore/python/framework/looper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function
from __future__ import absolute_import
# Copyright (C) 2014 Colin Bernet
# https://github.com/cbernet/heppy/blob/master/LICENSE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import unittest
import os
import shutil
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/framework/weight.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
# Copyright (C) 2014 Colin Bernet
# https://github.com/cbernet/heppy/blob/master/LICENSE

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/statistics/average_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import unittest

from .average import Average
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/statistics/counter_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import unittest
import os
import shutil
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/statistics/tree_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import unittest
from ROOT import TFile
from .tree import Tree
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/statistics/value_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import unittest
import math
from .value import Value
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/utils/addToDatasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Colin
# additional layer, on top of cmsBatch.py

from __future__ import absolute_import
import os

from .castorBaseDir import getUserAndArea
Expand Down
2 changes: 0 additions & 2 deletions PhysicsTools/HeppyCore/python/utils/batchmanager.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function
from __future__ import absolute_import
from datetime import datetime
from optparse import OptionParser

Expand Down
2 changes: 0 additions & 2 deletions PhysicsTools/HeppyCore/python/utils/castorBaseDir.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python
from __future__ import print_function
from __future__ import absolute_import
import os, sys
from . import eostools as castortools

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/utils/das.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""
DAS command line tool
"""
from __future__ import print_function
__author__ = "Valentin Kuznetsov"

import sys
Expand Down
2 changes: 0 additions & 2 deletions PhysicsTools/HeppyCore/python/utils/dataset.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python3

from __future__ import print_function
from __future__ import absolute_import
from builtins import range
import os
import pprint
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/utils/datasetToSource.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import os
from .dataset import Dataset, CMSDataset, LocalDataset, createDataset, PrivateDataset, createMyDataset

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/utils/dataset_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
from builtins import range
from .dataset import *

Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/utils/diclist_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import unittest

from .diclist import diclist
Expand Down
2 changes: 0 additions & 2 deletions PhysicsTools/HeppyCore/python/utils/edmIntegrityCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"""
Classes to check that a set of ROOT files are OK and publish a report
"""
from __future__ import print_function
from __future__ import absolute_import

from builtins import range
import datetime, fnmatch, json, os, shutil, sys, tempfile, time
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/utils/eostools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""
A module to manipulate files on EOS or on the local file system. Intended to have the same interface as castortools.py.
"""
from __future__ import print_function
import sys
import os
import re
Expand Down
2 changes: 0 additions & 2 deletions PhysicsTools/HeppyCore/python/utils/logger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function
from __future__ import absolute_import
from optparse import OptionParser
import sys,os, re, subprocess, datetime

Expand Down
2 changes: 0 additions & 2 deletions PhysicsTools/HeppyCore/python/utils/production_tasks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function
from __future__ import absolute_import

from builtins import range
import copy, datetime, inspect, fnmatch, os, re, subprocess, sys, tempfile, time
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/HeppyCore/python/utils/testtree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from builtins import range
from ROOT import TFile
from PhysicsTools.HeppyCore.statistics.tree import Tree
Expand Down
Loading

0 comments on commit 8d027cc

Please sign in to comment.