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

YAPF

parent e516e9d8
No related branches found
No related tags found
1 merge request!12Restructure
......@@ -162,5 +162,7 @@ def read_default_media_compositions():
try:
fpath = join(cfg.gseagen_path, "dat", GSEAGEN_MEDIA_COMPOSITION_FILE)
except:
fpath = abspath(join(dirname(__file__), "../config/", GSEAGEN_MEDIA_COMPOSITION_FILE))
fpath = abspath(
join(dirname(__file__), "../config/",
GSEAGEN_MEDIA_COMPOSITION_FILE))
return read_media_compositions(fpath)
......@@ -25,17 +25,20 @@ log = get_logger(basename(__file__))
MIN_SINGULARITY_VERSION = "3.3"
def check_singularity_version(): # pragma: no cover
if not is_singularity_version_greater(MIN_SINGULARITY_VERSION):
log.error("Singularity version lower than %s" %
MIN_SINGULARITY_VERSION)
raise OSError("Singularity version below %s" % MIN_SINGULARITY_VERSION)
def is_singularity_version_greater(min_version): # pragma: no cover
singularity_version = LooseVersion(get_singularity_version().split()[-1])
retval = singularity_version > LooseVersion(MIN_SINGULARITY_VERSION)
return retval
def build_image(output_dir):
if not isdir(output_dir):
raise OSError("Directory not found!")
......
......@@ -88,10 +88,12 @@ class Jobcard(f90nml.Namelist):
def read_jobcard(filepath):
return Jobcard(f90nml.read(filepath), filename=basename(filepath))
def write_jobcard(jobcard,filepath):
def write_jobcard(jobcard, filepath):
with open(filepath, 'w') as nml_file:
f90nml.write(jobcard, nml_file)
def generate_neutrino_jobcard(events,
process,
flavour,
......
......@@ -78,7 +78,9 @@ class TestCTRLbyJobcardObject(unittest.TestCase):
self.test_jobcard["neutrinoAnalysis"]["outputEvents"] = True
self.test_jobcard["pythia"]["PARP(91)"] = 0.44
self.output_dir = TemporaryDirectory()
self.retval = run_jobcard(self.test_jobcard, self.output_dir.name, container=True)
self.retval = run_jobcard(self.test_jobcard,
self.output_dir.name,
container=True)
# raise Exception(self.test_jobcard)
def test_output(self):
......
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