Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pileupCalc.py error #45742

Closed
BasChiara opened this issue Aug 19, 2024 · 14 comments
Closed

pileupCalc.py error #45742

BasChiara opened this issue Aug 19, 2024 · 14 comments

Comments

@BasChiara
Copy link

I am encountering issue with pileupCalc.py.
In CMSSW_13_0_13 the pileupCalc application lunched with this command :

pileupCalc.py -i /eos/user/c/cmsdqm/www/CAF/certification/Collisions22/Cert_Collisions2022_eraE_359022_360331_Golden.json --inputLumiJSON /eos/user/c/cmsdqm/www/CAF/certification/Collisions22/PileUp/EFG/pileup_JSON.txt --calcMode true --minBiasXsec 69200 --maxPileupBin 100 --numPileupBins 100  out.root

gives the following error :

Traceback (most recent call last):
  File "/cvmfs/cms.cern.ch/el8_amd64_gcc10/cms/cmssw/CMSSW_12_4_11/bin/el8_amd64_gcc10/pileupCalc.py", line 189, in <module>
    fillPileupHistogram(lumiInfo, options.calcMode,
  File "/cvmfs/cms.cern.ch/el8_amd64_gcc10/cms/cmssw/CMSSW_12_4_11/bin/el8_amd64_gcc10/pileupCalc.py", line 87, in fillPileupHistogram
    obs = binning.find(AveNumInt)
  File "/cvmfs/cms.cern.ch/el8_amd64_gcc10/cms/cmssw/CMSSW_12_4_11/bin/el8_amd64_gcc10/pileupCalc.py", line 65, in find
    return np.floor((x-self.xMin)*self.num/(self.xMax-self.xMin)).astype(np.int)
  File "/afs/cern.ch/user/c/cbasile/.local/lib/python3.9/site-packages/numpy/__init__.py", line 313, 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

Can you please help me with this, am I doing something wrong?
Thanks !

Chiara

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 19, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

A new Issue was created by @BasChiara.

@Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor

assign RecoLuminosity/LumiDB

@cmsbuild
Copy link
Contributor

New categories assigned: db

@francescobrivio,@saumyaphor4252,@perrotta,@consuegs you have been requested to review this Pull request/Issue and eventually sign? Thanks

@mmusich
Copy link
Contributor

mmusich commented Aug 19, 2024

type lumi

@mmusich
Copy link
Contributor

mmusich commented Aug 19, 2024

@cms-sw/lumi-pog-l2 @romeof FYI

@cmsbuild cmsbuild added the lumi label Aug 19, 2024
@mmusich
Copy link
Contributor

mmusich commented Aug 19, 2024

something along:

diff --git a/RecoLuminosity/LumiDB/scripts/pileupCalc.py b/RecoLuminosity/LumiDB/scripts/pileupCalc.py
index 4c38b77d5e8..60740decba2 100755
--- a/RecoLuminosity/LumiDB/scripts/pileupCalc.py
+++ b/RecoLuminosity/LumiDB/scripts/pileupCalc.py
@@ -62,7 +62,7 @@ class EquidistantBinning(object):
     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)
 

seems enough to fix the issue.

@mmusich
Copy link
Contributor

mmusich commented Sep 14, 2024

this should be fixed by #45989

@perrotta
Copy link
Contributor

+db

@cmsbuild
Copy link
Contributor

This issue is fully signed and ready to be closed.

@makortel
Copy link
Contributor

@cmsbuild, please test

@perrotta
Copy link
Contributor

@cmsbuild, please test

Ahem, @makortel : maybe you intended "please close" instead?

@makortel
Copy link
Contributor

@cmsbuild, please close

@makortel
Copy link
Contributor

@cmsbuild, please test

Ahem, @makortel : maybe you intended "please close" instead?

Thanks! Indeed. Too early in the morning...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants