Skip to content
Snippets Groups Projects
Commit 28973ceb authored by Johannes Schumann's avatar Johannes Schumann
Browse files

Fix for fluxfile usage

parent 50ba43b8
No related branches found
No related tags found
1 merge request!1Merge python environment
...@@ -25,7 +25,8 @@ from .environment import is_singularity_version_greater, MIN_SINGULARITY_VERSION ...@@ -25,7 +25,8 @@ from .environment import is_singularity_version_greater, MIN_SINGULARITY_VERSION
log = get_logger(basename(__file__)) log = get_logger(basename(__file__))
if not is_singularity_version_greater(MIN_SINGULARITY_VERSION): # pragma: no cover if not is_singularity_version_greater(
MIN_SINGULARITY_VERSION): # pragma: no cover
log.error("Singularity version lower than %s" % MIN_SINGULARITY_VERSION) log.error("Singularity version lower than %s" % MIN_SINGULARITY_VERSION)
raise OSError("Singularity version below %s" % MIN_SINGULARITY_VERSION) raise OSError("Singularity version below %s" % MIN_SINGULARITY_VERSION)
...@@ -66,12 +67,14 @@ def run_jobcard(jobcard, outdir, fluxfile=None): ...@@ -66,12 +67,14 @@ def run_jobcard(jobcard, outdir, fluxfile=None):
if isinstance(jobcard, str) and isfile(jobcard): if isinstance(jobcard, str) and isfile(jobcard):
jobcard = read_jobcard(jobcard) jobcard = read_jobcard(jobcard)
if "initneutrino" in jobcard and jobcard["initneutrino"]["nuexp"] == 99: if "neutrino_induced" in jobcard and jobcard["neutrino_induced"][
"nuexp"] == 99:
if fluxfile is None or not isfile(fluxfile): if fluxfile is None or not isfile(fluxfile):
raise IOError("Fluxfile not found!") raise IOError("Fluxfile not found!")
tmp_fluxfile = join(input_dir.name, basename(fluxfile)) tmp_fluxfile = join(input_dir.name, basename(fluxfile))
os.system("cp %s %s" % (fluxfile, tmp_fluxfile)) os.system("cp %s %s" % (fluxfile, tmp_fluxfile))
jobcard["initneutrino"]["filenameflux"] = tmp_fluxfile log.info("Set FileNameFlux to: %s" % tmp_fluxfile)
jobcard["neutrino_induced"]["FileNameflux"] = tmp_fluxfile
if isinstance(jobcard, Jobcard): if isinstance(jobcard, Jobcard):
with open(jobcard_fpath, "w") as f: with open(jobcard_fpath, "w") as f:
f.write(str(jobcard)) f.write(str(jobcard))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment