Skip to content

Commit

Permalink
clean up before making pypi packages. corrected debug msgs in resummino
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangWaltenberger committed Dec 6, 2023
1 parent f38f3ff commit f5b05c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 9 additions & 6 deletions smodels/tools/xsecResummino.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit f5b05c5

Please sign in to comment.