From 41a445003268b3b8cb367fdc68012ed44612c238 Mon Sep 17 00:00:00 2001 From: Izaak Date: Thu, 12 Sep 2024 14:39:12 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Typo:=20runNumber=20=E2=86=92=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RecoLuminosity/LumiDB/scripts/makePileupJSON.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoLuminosity/LumiDB/scripts/makePileupJSON.py b/RecoLuminosity/LumiDB/scripts/makePileupJSON.py index ee0c991cd0424..b2e3c1fc57d1f 100755 --- a/RecoLuminosity/LumiDB/scripts/makePileupJSON.py +++ b/RecoLuminosity/LumiDB/scripts/makePileupJSON.py @@ -134,7 +134,7 @@ mean_pileup = bunch_del_lumi * parameters.orbitLength / parameters.lumiSectionLength if mean_pileup > 100: print("mean number of pileup events > 100 for run %d, lum %d : m %f l %f" % \ - (runNumber, lumi_section, mean_pileup, bunch_del_lumi)) + (run, lumi_section, mean_pileup, bunch_del_lumi)) #print "mean number of pileup events for lum %d: m %f idx %d l %f" % (lumi_section, mean_pileup, bxid, bunch_rec_lumi) total_int2 += bunch_rec_lumi*(mean_pileup-mean_int)*(mean_pileup-mean_int) From 9ad24f84e95a12289202cacb1dea2c934c6ab398 Mon Sep 17 00:00:00 2001 From: Izaak Date: Thu, 12 Sep 2024 18:33:24 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Fix=20AttributeError=20due=20to=20deprecate?= =?UTF-8?q?d=20`np.int`=20=E2=86=92=20`int`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes ``` Traceback (most recent call last): File "/cvmfs/cms.cern.ch/el9_amd64_gcc12/cms/cmssw/CMSSW_14_1_0_pre4/bin/el9_amd64_gcc12/pileupCalc.py", line 189, in fillPileupHistogram(lumiInfo, options.calcMode, File "/cvmfs/cms.cern.ch/el9_amd64_gcc12/cms/cmssw/CMSSW_14_1_0_pre4/bin/el9_amd64_gcc12/pileupCalc.py", line 87, in fillPileupHistogram obs = binning.find(AveNumInt) File "/cvmfs/cms.cern.ch/el9_amd64_gcc12/cms/cmssw/CMSSW_14_1_0_pre4/bin/el9_amd64_gcc12/pileupCalc.py", line 65, in find return np.floor((x-self.xMin)*self.num/(self.xMax-self.xMin)).astype(np.int) File "/cvmfs/cms.cern.ch/el9_amd64_gcc12/external/py3-numpy/1.24.3-ac08ea497df571aa0b37dc29bb7a2045/lib/python3.9/site-packages/numpy/__init__.py", line 305, in __getattr__ raise AttributeError(__former_attrs__[attr]) AttributeError: module 'numpy' has no attribute 'int'. `np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations ``` --- RecoLuminosity/LumiDB/scripts/pileupCalc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoLuminosity/LumiDB/scripts/pileupCalc.py b/RecoLuminosity/LumiDB/scripts/pileupCalc.py index 4c38b77d5e81c..60740decba23e 100755 --- a/RecoLuminosity/LumiDB/scripts/pileupCalc.py +++ b/RecoLuminosity/LumiDB/scripts/pileupCalc.py @@ -62,7 +62,7 @@ def __init__(self, num, xMin, xMax): def width(self): return (self.xMax-self.xMin)/self.num def find(self, x): - return np.floor((x-self.xMin)*self.num/(self.xMax-self.xMin)).astype(np.int) + return np.floor((x-self.xMin)*self.num/(self.xMax-self.xMin)).astype(int) Sqrt2 = np.sqrt(2)