From f5b05c55b8b3eafe871ae451018f97717bb5e0b1 Mon Sep 17 00:00:00 2001 From: Wolfgang Waltenberger Date: Wed, 6 Dec 2023 11:01:23 +0100 Subject: [PATCH] clean up before making pypi packages. corrected debug msgs in resummino --- Makefile | 4 ++-- smodels/tools/xsecResummino.py | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 4d3bc6204..44c320b7a 100644 --- a/Makefile +++ b/Makefile @@ -68,13 +68,13 @@ buildrpm: builddeb: buildrpm cd dist && fakeroot alien smodels-$(VER)-1.x86_64.rpm -pypi: +pypi: clean ## pypi user is walten, repository is https://upload.pypi.org/legacy/ rm -rf dist python3 setup.py sdist bdist_wheel twine upload dist/smodels-*.tar.gz -testpypi: +testpypi: clean ## testpypi user is smodels, repository is https://test.pypi.org/legacy/ # to install from testpypi: # pip3 install --user --upgrade --index-url https://test.pypi.org/simple/ smodels diff --git a/smodels/tools/xsecResummino.py b/smodels/tools/xsecResummino.py index 2945ce3e8..a04028deb 100644 --- a/smodels/tools/xsecResummino.py +++ b/smodels/tools/xsecResummino.py @@ -161,8 +161,11 @@ def launch_command(self,resummino_bin,input_file, output_file, order): command = f"{resummino_bin} {input_file}" with open(output_file, 'w') as f: - with open("/dev/null", "w") as errorhandle: - subprocess.run(command, shell=True, stdout=f,stderr=errorhandle, text=True) + if self.verbosity == "debug": + subprocess.run(command, shell=True, stdout=f,stderr=os.sys.stderr, text=True) + else: + with open("/dev/null", "w") as errorhandle: + subprocess.run(command, shell=True, stdout=f,stderr=errorhandle, text=True) def launch_resummino(self, input_file, slha_file, output_file, particle_1, particle_2, num_try, order, Xsections, log): @@ -182,7 +185,7 @@ def launch_resummino(self, input_file, slha_file, output_file, particle_1, parti already_written_channel_set = [({x,y},z,w) for (x,y), z,w in already_written_channel] - logger.debug("channel, order and cross section " + str(particle_1)+str(particle_2)+ str(order)+ str(_)) + logger.debug(f"channel, order and cross section {str(particle_1)} {str(particle_2)} {str(order)} {str(_)}" ) logger.debug('the already written channels are '+ str(already_written_channel)) if (((particle_1, particle_2), _, order)) in already_written_channel: return @@ -235,7 +238,7 @@ def search_in_output(self, output_file): """ Search in the .out files of resummino (in tempfiles) to get the cross section asked by the users, then extract the LO,NLO and NLL+NLO. - If you want to get the incertitude given by resummino, you have everything here in LO, NLO and NLL. + If you want to get the incertainties given by resummino, you have everything here in LO, NLO and NLL. """ Infos = [] with open(output_file, 'r') as f: @@ -278,9 +281,9 @@ def create_xsection(self, result, particle_1, particle_2, order, Xsections): def write_in_slha(self, output_file, slha_file, order, particle_1, particle_2, type_writing, Xsections, log): """ - Organize here the way cross section are written onto the file (highest, + Organize here the way cross sections are written into the file (highest, all) and then create cross_section object to let smodels take - care of the writting itself with the create_xsection method. + care of the writing itself with the create_xsection method. """ results = self.search_in_output(output_file) if type_writing == 'highest':