From 7d052fa136d60abd9cf4d743b83fd0951b0349a4 Mon Sep 17 00:00:00 2001 From: "Jack Y. Araz" Date: Wed, 13 Sep 2023 09:56:53 +0100 Subject: [PATCH 1/5] update zlib version permanently --- madanalysis/install/install_zlib.py | 184 +++++++++++++++------------- 1 file changed, 99 insertions(+), 85 deletions(-) diff --git a/madanalysis/install/install_zlib.py b/madanalysis/install/install_zlib.py index fcfc934e..1761a370 100644 --- a/madanalysis/install/install_zlib.py +++ b/madanalysis/install/install_zlib.py @@ -1,189 +1,203 @@ ################################################################################ -# +# # Copyright (C) 2012-2023 Jack Araz, Eric Conte & Benjamin Fuks # The MadAnalysis development team, email: -# +# # This file is part of MadAnalysis 5. # Official website: -# +# # MadAnalysis 5 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # MadAnalysis 5 is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with MadAnalysis 5. If not, see -# +# ################################################################################ from __future__ import absolute_import -from madanalysis.install.install_service import InstallService -from shell_command import ShellCommand + +import logging import os import sys -import logging -class InstallZlib: +from shell_command import ShellCommand + +from madanalysis.install.install_service import InstallService + - def __init__(self,main): - self.main = main - self.installdir = os.path.normpath(self.main.archi_info.ma5dir+'/tools/zlib/') - self.toolsdir = os.path.normpath(self.main.archi_info.ma5dir+'/tools') - self.tmpdir = self.main.session_info.tmpdir +class InstallZlib: + def __init__(self, main): + self.main = main + self.installdir = os.path.normpath(self.main.archi_info.ma5dir + "/tools/zlib/") + self.toolsdir = os.path.normpath(self.main.archi_info.ma5dir + "/tools") + self.tmpdir = self.main.session_info.tmpdir self.downloaddir = self.main.session_info.downloaddir - self.untardir = os.path.normpath(self.tmpdir + '/MA5_zlib/') - self.ncores = 1 - self.files = {"zlib.tar.gz" : "http://zlib.net/zlib-1.2.13.tar.gz"} - + self.untardir = os.path.normpath(self.tmpdir + "/MA5_zlib/") + self.ncores = 1 + self.files = {"zlib.tar.gz": "https://zlib.net/current/zlib.tar.gz"} def Detect(self): if not os.path.isdir(self.toolsdir): - logging.getLogger('MA5').debug("The folder '"+self.toolsdir+"' is not found") + logging.getLogger("MA5").debug( + "The folder '" + self.toolsdir + "' is not found" + ) return False if not os.path.isdir(self.installdir): - logging.getLogger('MA5').debug("The folder "+self.installdir+"' is not found") + logging.getLogger("MA5").debug( + "The folder " + self.installdir + "' is not found" + ) return False return True - - def Remove(self,question=True): + def Remove(self, question=True): from madanalysis.IOinterface.folder_writer import FolderWriter - return FolderWriter.RemoveDirectory(self.installdir,question) + return FolderWriter.RemoveDirectory(self.installdir, question) def GetNcores(self): - self.ncores = InstallService.get_ncores(self.main.archi_info.ncores,\ - self.main.forced) - + self.ncores = InstallService.get_ncores( + self.main.archi_info.ncores, self.main.forced + ) def CreatePackageFolder(self): if not InstallService.create_tools_folder(self.toolsdir): return False - if not InstallService.create_package_folder(self.toolsdir,'zlib'): + if not InstallService.create_package_folder(self.toolsdir, "zlib"): return False return True - def CreateTmpFolder(self): ok = InstallService.prepare_tmp(self.untardir, self.downloaddir) if ok: - self.tmpdir=self.untardir + self.tmpdir = self.untardir return ok - + def Download(self): # Checking connection with MA5 web site if not InstallService.check_ma5site(): return False # Launching wget - logname = os.path.normpath(self.installdir+'/wget.log') - if not InstallService.wget(self.files,logname,self.downloaddir): + logname = os.path.normpath(self.installdir + "/wget.log") + if not InstallService.wget(self.files, logname, self.downloaddir): return False # Ok return True - def Unpack(self): # Logname - logname = os.path.normpath(self.installdir+'/unpack.log') + logname = os.path.normpath(self.installdir + "/unpack.log") # Unpacking the tarball - ok, packagedir = InstallService.untar(logname, self.downloaddir, self.tmpdir,'zlib.tar.gz') + ok, packagedir = InstallService.untar( + logname, self.downloaddir, self.tmpdir, "zlib.tar.gz" + ) if not ok: return False # Ok: returning the good folder - self.tmpdir=packagedir + self.tmpdir = packagedir return True - def Configure(self): # Input - theCommands=['./configure','--prefix='+self.installdir] - logname=os.path.normpath(self.installdir+'/configuration.log') + theCommands = ["./configure", "--prefix=" + self.installdir] + logname = os.path.normpath(self.installdir + "/configuration.log") # Execute - logging.getLogger('MA5').debug('shell command: '+' '.join(theCommands)) - ok, out= ShellCommand.ExecuteWithLog(theCommands,\ - logname,\ - self.tmpdir,\ - silent=False) + logging.getLogger("MA5").debug("shell command: " + " ".join(theCommands)) + ok, out = ShellCommand.ExecuteWithLog( + theCommands, logname, self.tmpdir, silent=False + ) # return result if not ok: - logging.getLogger('MA5').error('impossible to configure the project. For more details, see the log file:') - logging.getLogger('MA5').error(logname) + logging.getLogger("MA5").error( + "impossible to configure the project. For more details, see the log file:" + ) + logging.getLogger("MA5").error(logname) return ok - def Build(self): # Input - theCommands=['make','-j'+str(self.ncores)] - logname=os.path.normpath(self.installdir+'/compilation.log') + theCommands = ["make", "-j" + str(self.ncores)] + logname = os.path.normpath(self.installdir + "/compilation.log") # Execute - logging.getLogger('MA5').debug('shell command: '+' '.join(theCommands)) - ok, out= ShellCommand.ExecuteWithLog(theCommands,\ - logname,\ - self.tmpdir,\ - silent=False) + logging.getLogger("MA5").debug("shell command: " + " ".join(theCommands)) + ok, out = ShellCommand.ExecuteWithLog( + theCommands, logname, self.tmpdir, silent=False + ) # return result if not ok: - logging.getLogger('MA5').error('impossible to build the project. For more details, see the log file:') - logging.getLogger('MA5').error(logname) + logging.getLogger("MA5").error( + "impossible to build the project. For more details, see the log file:" + ) + logging.getLogger("MA5").error(logname) return ok - def Install(self): # Input - theCommands=['make','install'] - logname=os.path.normpath(self.installdir+'/installation.log') + theCommands = ["make", "install"] + logname = os.path.normpath(self.installdir + "/installation.log") # Execute - logging.getLogger('MA5').debug('shell command: '+' '.join(theCommands)) - ok, out= ShellCommand.ExecuteWithLog(theCommands,\ - logname,\ - self.tmpdir,\ - silent=False) + logging.getLogger("MA5").debug("shell command: " + " ".join(theCommands)) + ok, out = ShellCommand.ExecuteWithLog( + theCommands, logname, self.tmpdir, silent=False + ) # return result if not ok: - logging.getLogger('MA5').error('impossible to build the project. For more details, see the log file:') - logging.getLogger('MA5').error(logname) + logging.getLogger("MA5").error( + "impossible to build the project. For more details, see the log file:" + ) + logging.getLogger("MA5").error(logname) return ok - def Check(self): # Check folders - dirs = [self.installdir+"/include",\ - self.installdir+"/lib"] + dirs = [self.installdir + "/include", self.installdir + "/lib"] for dir in dirs: if not os.path.isdir(dir): - logging.getLogger('MA5').error('folder '+dir+' is missing.') + logging.getLogger("MA5").error("folder " + dir + " is missing.") self.display_log() return False # Check one header file - if not os.path.isfile(self.installdir+'/include/zlib.h'): - logging.getLogger('MA5').error("header labeled 'include/zlib.h' is missing.") + if not os.path.isfile(self.installdir + "/include/zlib.h"): + logging.getLogger("MA5").error("header labeled 'include/zlib.h' is missing.") self.display_log() return False - if (not os.path.isfile(self.installdir+'/lib/libz.so')) and \ - (not os.path.isfile(self.installdir+'/lib/libz.a')): - logging.getLogger('MA5').error("library labeled 'libz.so' or 'libz.a' is missing.") + if (not os.path.isfile(self.installdir + "/lib/libz.so")) and ( + not os.path.isfile(self.installdir + "/lib/libz.a") + ): + logging.getLogger("MA5").error( + "library labeled 'libz.so' or 'libz.a' is missing." + ) self.display_log() return False - + return True def display_log(self): - logging.getLogger('MA5').error("More details can be found into the log files:") - logging.getLogger('MA5').error(" - "+os.path.normpath(self.installdir+"/wget.log")) - logging.getLogger('MA5').error(" - "+os.path.normpath(self.installdir+"/unpack.log")) - logging.getLogger('MA5').error(" - "+os.path.normpath(self.installdir+"/configuration.log")) - logging.getLogger('MA5').error(" - "+os.path.normpath(self.installdir+"/compilation.log")) - logging.getLogger('MA5').error(" - "+os.path.normpath(self.installdir+"/installation.log")) + logging.getLogger("MA5").error("More details can be found into the log files:") + logging.getLogger("MA5").error( + " - " + os.path.normpath(self.installdir + "/wget.log") + ) + logging.getLogger("MA5").error( + " - " + os.path.normpath(self.installdir + "/unpack.log") + ) + logging.getLogger("MA5").error( + " - " + os.path.normpath(self.installdir + "/configuration.log") + ) + logging.getLogger("MA5").error( + " - " + os.path.normpath(self.installdir + "/compilation.log") + ) + logging.getLogger("MA5").error( + " - " + os.path.normpath(self.installdir + "/installation.log") + ) def NeedToRestart(self): return True - - From ca7ccb521e8f90ea65d2885ee946e152219717a4 Mon Sep 17 00:00:00 2001 From: "Jack Y. Araz" Date: Wed, 13 Sep 2023 10:04:06 +0100 Subject: [PATCH 2/5] bump the version --- bin/ma5 | 55 ++-- .../Commons/Base/Configuration.cpp | 305 +++++++++--------- 2 files changed, 181 insertions(+), 179 deletions(-) diff --git a/bin/ma5 b/bin/ma5 index e523f9bf..22c4bb19 100755 --- a/bin/ma5 +++ b/bin/ma5 @@ -1,26 +1,26 @@ #!/usr/bin/env python ################################################################################ -# +# # Copyright (C) 2012-2023 Jack Araz, Eric Conte & Benjamin Fuks # The MadAnalysis development team, email: -# +# # This file is part of MadAnalysis 5. # Official website: -# +# # MadAnalysis 5 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # MadAnalysis 5 is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with MadAnalysis 5. If not, see -# +# ################################################################################ @@ -33,46 +33,51 @@ and call immediately the command line interface scripts""" # Checking if the correct release of Python is installed import sys -if sys.version_info[0] != 3 or sys.version_info[1] <= 6: - sys.exit('Python release '+ sys.version + ' is detected.\n' + \ - 'MadAnalysis 5 works only with Python version 3.6 or more recent version.\n' + \ - 'Please upgrade your Python installation.') + +if sys.version_info[0] != 3 or sys.version_info[1] <= 6: + sys.exit( + "Python release " + + sys.version + + " is detected.\n" + + "MadAnalysis 5 works only with Python version 3.6 or more recent version.\n" + + "Please upgrade your Python installation." + ) # Checking that the 'six' package is present try: import six except: - sys.exit('The python "six" module is not found on your system and it is required for MadAnalysis 5 for ' +\ - 'a question of Python 2/3 compatibility. Please install it with the following command:\n' +\ - 'pip install six') + sys.exit( + 'The python "six" module is not found on your system and it is required for MadAnalysis 5 for ' + + "a question of Python 2/3 compatibility. Please install it with the following command:\n" + + "pip install six" + ) # Getting the parent directory (ma5 root dir) of the script real path (bin) import os -import optparse -ma5dir = os.path.split(os.path.dirname(os.path.realpath( __file__ )))[0] + +ma5dir = os.path.split(os.path.dirname(os.path.realpath(__file__)))[0] if not os.path.isdir(ma5dir): - sys.exit('Detected MadAnalysis 5 general folder is not correct:\n' +\ - ma5dir) -os.environ['MA5_BASE']=ma5dir + sys.exit("Detected MadAnalysis 5 general folder is not correct:\n" + ma5dir) +os.environ["MA5_BASE"] = ma5dir # Adding the MadAnalysis 5 folder to the current PYTHONPATH # -> allowing to use MadAnalysis 5 python files sys.path.insert(0, ma5dir) # Adding the python service folder to the current PYTHONPATH -servicedir = ma5dir+'/tools/ReportGenerator/Services/' +servicedir = ma5dir + "/tools/ReportGenerator/Services/" servicedir = os.path.normpath(servicedir) if not os.path.isdir(servicedir): - sys.exit('Detected MadAnalysis 5 service folder is not correct:\n' + ma5dir) + sys.exit("Detected MadAnalysis 5 service folder is not correct:\n" + ma5dir) sys.path.insert(0, servicedir) # Release version -# Do not touch it !!!!! -version = "1.10.11" -date = "2023/08/18" +# Do not touch it !!!!! +version = "1.10.12" +date = "2023/09/13" # Loading the MadAnalysis session import madanalysis.core.launcher -madanalysis.core.launcher.LaunchMA5(version, date, ma5dir) - +madanalysis.core.launcher.LaunchMA5(version, date, ma5dir) diff --git a/tools/SampleAnalyzer/Commons/Base/Configuration.cpp b/tools/SampleAnalyzer/Commons/Base/Configuration.cpp index 772a65ef..5b35d14c 100644 --- a/tools/SampleAnalyzer/Commons/Base/Configuration.cpp +++ b/tools/SampleAnalyzer/Commons/Base/Configuration.cpp @@ -1,27 +1,26 @@ //////////////////////////////////////////////////////////////////////////////// -// +// // Copyright (C) 2012-2023 Jack Araz, Eric Conte & Benjamin Fuks // The MadAnalysis development team, email: -// +// // This file is part of MadAnalysis 5. // Official website: -// +// // MadAnalysis 5 is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// +// // MadAnalysis 5 is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with MadAnalysis 5. If not, see -// +// //////////////////////////////////////////////////////////////////////////////// - // STL headers #include #include @@ -32,16 +31,14 @@ #include "SampleAnalyzer/Commons/Service/LogService.h" #include "SampleAnalyzer/Commons/Service/ExceptionService.h" - using namespace MA5; - // ----------------------------------------------------------------------------- // Initializing static data members // ----------------------------------------------------------------------------- // DO NOT TOUCH THESE LINES -const std::string Configuration::sampleanalyzer_version_ = "1.10.11"; -const std::string Configuration::sampleanalyzer_date_ = "2023/08/18"; +const std::string Configuration::sampleanalyzer_version_ = "1.10.12"; +const std::string Configuration::sampleanalyzer_date_ = "2023/09/13"; // DO NOT TOUCH THESE LINES // ----------------------------------------------------------------------------- @@ -49,179 +46,179 @@ const std::string Configuration::sampleanalyzer_date_ = "2023/08/18"; // ----------------------------------------------------------------------------- void Configuration::PrintSyntax() { - INFO << endmsg; - INFO << "Syntax : SampleAnalyzer [option] " << endmsg; - INFO << " with = txt file containing all sample file names" << endmsg; - INFO << " with [option] = " << endmsg; - INFO << " --check_event : check the compliance of the event file" << endmsg; - INFO << " --no_event_weight : the event weights are not used" << endmsg; - INFO << " --ma5_version : returns the version of this release" << endmsg; - INFO << " Any aditional option for the analyzer can be given with the following syntax:" << endmsg; - INFO << " --=" << endmsg; - INFO << endmsg; + INFO << endmsg; + INFO << "Syntax : SampleAnalyzer [option] " << endmsg; + INFO << " with = txt file containing all sample file names" << endmsg; + INFO << " with [option] = " << endmsg; + INFO << " --check_event : check the compliance of the event file" << endmsg; + INFO << " --no_event_weight : the event weights are not used" << endmsg; + INFO << " --ma5_version : returns the version of this release" << endmsg; + INFO << " Any aditional option for the analyzer can be given with the following syntax:" << endmsg; + INFO << " --=" << endmsg; + INFO << endmsg; } - // ----------------------------------------------------------------------------- // Lower // ----------------------------------------------------------------------------- -void Configuration::Lower(std::string& word) +void Configuration::Lower(std::string &word) { - std::transform(word.begin(), word.end(), - word.begin(), - (MAint32 (*)(MAint32))std::tolower); + std::transform(word.begin(), word.end(), + word.begin(), + (MAint32(*)(MAint32))std::tolower); } - - // ----------------------------------------------------------------------------- // DecodeMA5version // ----------------------------------------------------------------------------- -void Configuration::DecodeMA5version(const std::string& option) +void Configuration::DecodeMA5version(const std::string &option) { - std::string stamp = option.substr(14,std::string::npos); - std::size_t result = stamp.find(";"); - try - { - // check the syntax - if (result==std::string::npos) throw EXCEPTION_WARNING("MA5 version '"+stamp+"' is not valid.","",0); - - // version - pythoninterface_version_ = stamp.substr(0,result); - if (pythoninterface_version_.find("\"")==0) - pythoninterface_version_ = pythoninterface_version_.substr(1,std::string::npos); - if (pythoninterface_version_.size()>=2) - if (pythoninterface_version_.find("\"")==(pythoninterface_version_.size()-1)) - pythoninterface_version_ = pythoninterface_version_.substr(0,(pythoninterface_version_.size()-1)); - - // date - pythoninterface_date_ = stamp.substr(result+1,std::string::npos); - if (pythoninterface_date_.find("\"")==0) - pythoninterface_date_ = pythoninterface_date_.substr(1,std::string::npos); - if (pythoninterface_date_.size()>=2) - if (pythoninterface_date_.find("\"")==(pythoninterface_date_.size()-1)) - pythoninterface_date_ = pythoninterface_date_.substr(0,(pythoninterface_date_.size()-1)); - } - catch(const std::exception& e) - { - MANAGE_EXCEPTION(e); - } + std::string stamp = option.substr(14, std::string::npos); + std::size_t result = stamp.find(";"); + try + { + // check the syntax + if (result == std::string::npos) + throw EXCEPTION_WARNING("MA5 version '" + stamp + "' is not valid.", "", 0); + + // version + pythoninterface_version_ = stamp.substr(0, result); + if (pythoninterface_version_.find("\"") == 0) + pythoninterface_version_ = pythoninterface_version_.substr(1, std::string::npos); + if (pythoninterface_version_.size() >= 2) + if (pythoninterface_version_.find("\"") == (pythoninterface_version_.size() - 1)) + pythoninterface_version_ = pythoninterface_version_.substr(0, (pythoninterface_version_.size() - 1)); + + // date + pythoninterface_date_ = stamp.substr(result + 1, std::string::npos); + if (pythoninterface_date_.find("\"") == 0) + pythoninterface_date_ = pythoninterface_date_.substr(1, std::string::npos); + if (pythoninterface_date_.size() >= 2) + if (pythoninterface_date_.find("\"") == (pythoninterface_date_.size() - 1)) + pythoninterface_date_ = pythoninterface_date_.substr(0, (pythoninterface_date_.size() - 1)); + } + catch (const std::exception &e) + { + MANAGE_EXCEPTION(e); + } } - // ----------------------------------------------------------------------------- // Initialize // ----------------------------------------------------------------------------- MAbool Configuration::Initialize(MAint32 &argc, MAchar *argv[]) { - // Checking number of arguments - // is compulsory - if (argc<2) - { - ERROR << "number of arguments is incorrect." << endmsg; - PrintSyntax(); - return false; - } - - // Decoding arguments - for (MAuint32 i=1;i(argc);i++) - { - // converting const characters into string - std::string argument = std::string(argv[i]); - Lower(argument); - - // safety : skip empty string - if (argument.size()==0) continue; - - // Is it an option? - if (argument.size()>=2 && argument[0]=='-' && argument[1]=='-') + // Checking number of arguments + // is compulsory + if (argc < 2) { - // check event - if (argument=="--check_event") check_event_ = true; - - // weighted event - else if (argument=="--no_event_weight") no_event_weight_ = true; - - // version - else if (argument.find("--ma5_version=")==0) DecodeMA5version(argument); - - // other = command line options - else - { - std::string arg = argv[i]; - MAuint32 loc = arg.find("="); - if (loc == 0 || loc > arg.length()) - { - ERROR << "option '" << argument << "' unknown." << endmsg; - PrintSyntax(); - return false; - } - std::string name = arg.substr(2,loc-2); - std::string value = arg.substr(loc+1,arg.length()-1); - options_[name] = value; - } - } - - // It is not an option? So it is a list of samples - else + ERROR << "number of arguments is incorrect." << endmsg; + PrintSyntax(); + return false; + } + + // Decoding arguments + for (MAuint32 i = 1; i < static_cast(argc); i++) { - if (input_list_name_=="" || input_list_name_==std::string(argv[i])) - { - // Extracting the input list - input_list_name_ = std::string(argv[i]); - } - else - { - // only one list of samples is required - ERROR << "several list of samples have been declared: '" - << input_list_name_ << "' and '" << argv[i] - << "'. Only one is required." << endmsg; + // converting const characters into string + std::string argument = std::string(argv[i]); + Lower(argument); + + // safety : skip empty string + if (argument.size() == 0) + continue; + + // Is it an option? + if (argument.size() >= 2 && argument[0] == '-' && argument[1] == '-') + { + // check event + if (argument == "--check_event") + check_event_ = true; + + // weighted event + else if (argument == "--no_event_weight") + no_event_weight_ = true; + + // version + else if (argument.find("--ma5_version=") == 0) + DecodeMA5version(argument); + + // other = command line options + else + { + std::string arg = argv[i]; + MAuint32 loc = arg.find("="); + if (loc == 0 || loc > arg.length()) + { + ERROR << "option '" << argument << "' unknown." << endmsg; + PrintSyntax(); + return false; + } + std::string name = arg.substr(2, loc - 2); + std::string value = arg.substr(loc + 1, arg.length() - 1); + options_[name] = value; + } + } + + // It is not an option? So it is a list of samples + else + { + if (input_list_name_ == "" || input_list_name_ == std::string(argv[i])) + { + // Extracting the input list + input_list_name_ = std::string(argv[i]); + } + else + { + // only one list of samples is required + ERROR << "several list of samples have been declared: '" + << input_list_name_ << "' and '" << argv[i] + << "'. Only one is required." << endmsg; + return false; + } + } + } + + // Check that the input list is supplied + if (input_list_name_ == "") + { + ERROR << "no list of samples has been provided." << endmsg; + PrintSyntax(); return false; - } } - } - - // Check that the input list is supplied - if (input_list_name_=="") - { - ERROR << "no list of samples has been provided." << endmsg; - PrintSyntax(); - return false; - } - - // Ok - return true; -} + // Ok + return true; +} // ----------------------------------------------------------------------------- // Display // ----------------------------------------------------------------------------- void Configuration::Display() { - INFO << " - version: " << sampleanalyzer_version_ << " (" << sampleanalyzer_date_ << ") "; - if ((sampleanalyzer_version_!=pythoninterface_version_ && pythoninterface_version_!="") || - (sampleanalyzer_date_!=pythoninterface_date_ && pythoninterface_version_!="")) - INFO << "[ python interface version: " << pythoninterface_version_ - << " (" << pythoninterface_date_ << ") ]"; - INFO << endmsg; - - INFO << " - general: "; - - // Is there option ? - if (!check_event_ && !no_event_weight_) - { - INFO << "everything is default." << endmsg; - return; - } - else - { + INFO << " - version: " << sampleanalyzer_version_ << " (" << sampleanalyzer_date_ << ") "; + if ((sampleanalyzer_version_ != pythoninterface_version_ && pythoninterface_version_ != "") || + (sampleanalyzer_date_ != pythoninterface_date_ && pythoninterface_version_ != "")) + INFO << "[ python interface version: " << pythoninterface_version_ + << " (" << pythoninterface_date_ << ") ]"; INFO << endmsg; - } - // Displaying options - if (check_event_) - INFO << " -> checking the event file format." << endmsg; - if (no_event_weight_) - INFO << " -> event weights are not used." << endmsg; + INFO << " - general: "; + + // Is there option ? + if (!check_event_ && !no_event_weight_) + { + INFO << "everything is default." << endmsg; + return; + } + else + { + INFO << endmsg; + } + + // Displaying options + if (check_event_) + INFO << " -> checking the event file format." << endmsg; + if (no_event_weight_) + INFO << " -> event weights are not used." << endmsg; } From 283f01dcf45d2c975f2712a606dfa21cc49f1e7f Mon Sep 17 00:00:00 2001 From: "Jack Y. Araz" Date: Wed, 13 Sep 2023 10:08:51 +0100 Subject: [PATCH 3/5] update changelog --- doc/releases/changelog-v1.10.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/releases/changelog-v1.10.md b/doc/releases/changelog-v1.10.md index a6276d76..0ea2eb23 100644 --- a/doc/releases/changelog-v1.10.md +++ b/doc/releases/changelog-v1.10.md @@ -1,4 +1,4 @@ -# Release version 1.10.7 +# Release version 1.10.12 ## New features since last release @@ -68,6 +68,9 @@ ## Bug fixes +* Permanently fix the zlib version to the latest. + ([#219](https://github.com/MadAnalysis/madanalysis5/pull/219)) + * Zero division error fixed in the simplified likelihoods workflow. ([#4](https://github.com/MadAnalysis/madanalysis5/pull/4)) From 07a44ebb453940d70cb1585783ec63d818e31053 Mon Sep 17 00:00:00 2001 From: "Jack Y. Araz" Date: Wed, 13 Sep 2023 10:11:18 +0100 Subject: [PATCH 4/5] fix version number --- doc/releases/changelog-v1.10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/releases/changelog-v1.10.md b/doc/releases/changelog-v1.10.md index 0ea2eb23..26ce7ace 100644 --- a/doc/releases/changelog-v1.10.md +++ b/doc/releases/changelog-v1.10.md @@ -1,4 +1,4 @@ -# Release version 1.10.12 +# Release version 1.10 ## New features since last release From 1e43b5e1a5911ad47626628feba9b8a852f7bc59 Mon Sep 17 00:00:00 2001 From: "Jack Y. Araz" Date: Wed, 13 Sep 2023 10:17:34 +0100 Subject: [PATCH 5/5] update for efficiency --- bin/ma5 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/ma5 b/bin/ma5 index 22c4bb19..ed3e9f7d 100755 --- a/bin/ma5 +++ b/bin/ma5 @@ -28,12 +28,16 @@ # MAIN PROGRAM ################################################################################ -"""This is the main executable, a simple frontend to set up the PYTHONPATH -and call immediately the command line interface scripts""" +""" +This is the main executable, a simple frontend to set up the PYTHONPATH +and call immediately the command line interface scripts +""" -# Checking if the correct release of Python is installed +import importlib +import os import sys +# Checking if the correct release of Python is installed if sys.version_info[0] != 3 or sys.version_info[1] <= 6: sys.exit( "Python release " @@ -44,9 +48,7 @@ if sys.version_info[0] != 3 or sys.version_info[1] <= 6: ) # Checking that the 'six' package is present -try: - import six -except: +if not importlib.util.find_spec("six"): sys.exit( 'The python "six" module is not found on your system and it is required for MadAnalysis 5 for ' + "a question of Python 2/3 compatibility. Please install it with the following command:\n" @@ -54,8 +56,6 @@ except: ) # Getting the parent directory (ma5 root dir) of the script real path (bin) -import os - ma5dir = os.path.split(os.path.dirname(os.path.realpath(__file__)))[0] if not os.path.isdir(ma5dir): sys.exit("Detected MadAnalysis 5 general folder is not correct:\n" + ma5dir)