Moving to a python3-compatible code
Ensuring python3-compatible code, while keeping python2 compatibility. The code was tested with both python 2.7 and 3.9 (including on HTCondor).
In particular:
- calls to
print
modified (parentheses added, removingprint >>
for prints to file), -
time.clock()
->time.time()
-
np.int(...)
->int(...)
-
//
instead of/
for integer division, - removing
split
andreplace
functions fromstring
module (using corresponding methods fromstr
objects instead), -
list
added whenever needed (with e.g.range
,items()
,map
), - all semi-colons
;
removed, - using
npz
format for saving pickles and numpy arrays, and various options changed there, - handling of HTCondor batch job modified, and
DELPHI_script.py
as well.
There were also a few additional changes:
- a test script for noise (eta) calculation was added (with comparison with an approximated approach) in
DELPHI_Python/test_scripts/test_noise.py
. This replaces the one that was directly inDELPHI_Python/Noise.py
, now removed (to avoid uselessmatplotlib
imports when launching DELPHI calculations), - an old test script with various outdated tunespread claculations was removed in
DELPHI_Python/test_scripts/
, - the
README.txt
inDELPHI_Python/test_scripts/
has been changed accordingly, - clean-up of the LHC example script.
Edited by Nicolas Mounet