Skip to content
Snippets Groups Projects
Commit 36708750 authored by Christoph.Knote's avatar Christoph.Knote
Browse files

Updates to make restbox working again.

parent 5b8d0949
Branches
Tags
No related merge requests found
...@@ -8,7 +8,7 @@ if work_path is None: ...@@ -8,7 +8,7 @@ if work_path is None:
import warnings import warnings
warnings.warn("BOXMOX unusable - experiment execution disabled.") warnings.warn("BOXMOX unusable - experiment execution disabled.")
else: else:
from experiment import Experiment, ExperimentFromExample, ExperimentFromExistingRun, Namelist, examples from experiment import Experiment, ExperimentFromExample, ExperimentFromExistingRun, Namelist, examples, compiledMechs
try: try:
import matplotlib import matplotlib
......
...@@ -33,7 +33,11 @@ class ExampleData: ...@@ -33,7 +33,11 @@ class ExampleData:
self.path = path self.path = path
self.files = { x.replace(".csv", ""): os.path.join(self.path, x) for x in os.listdir(self.path) if '.csv' in x } self.files = { x.replace(".csv", ""): os.path.join(self.path, x) for x in os.listdir(self.path) if '.csv' in x }
examples = { x: ExampleData(os.path.join(examplesPath, x)) for x in os.listdir(examplesPath) if os.path.isdir( os.path.join(examplesPath, x))} examples = { x: ExampleData(os.path.join(examplesPath, x)) for x in os.listdir(examplesPath) if os.path.isdir( os.path.join(examplesPath, x) ) }
compiledMechsPath=os.path.join(os.environ['KPP_HOME'], "boxmox", "compiled_mechs")
compiledMechs = [ x for x in os.listdir(compiledMechsPath) if (os.path.isdir( os.path.join(compiledMechsPath, x) )) and ("_adjoint" not in x) ]
class Namelist: class Namelist:
''' '''
...@@ -300,6 +304,8 @@ class ExperimentFromExample(Experiment): ...@@ -300,6 +304,8 @@ class ExperimentFromExample(Experiment):
self.namelist = Namelist(os.path.join(self.path, 'BOXMOX.nml')) self.namelist = Namelist(os.path.join(self.path, 'BOXMOX.nml'))
self.mechanism = self._get_mechanism() self.mechanism = self._get_mechanism()
self.version = self._determineVersion(self.path)
def __new(self): def __new(self):
try: try:
s.check_output(["new_BOXMOX_experiment_from_example", "-f", self.example, self.path], stderr=s.STDOUT) s.check_output(["new_BOXMOX_experiment_from_example", "-f", self.example, self.path], stderr=s.STDOUT)
...@@ -336,8 +342,11 @@ class ExperimentFromExistingRun(Experiment): ...@@ -336,8 +342,11 @@ class ExperimentFromExistingRun(Experiment):
self.namelist = Namelist(os.path.join(self.path, 'BOXMOX.nml')) self.namelist = Namelist(os.path.join(self.path, 'BOXMOX.nml'))
self.mechanism = self._get_mechanism() self.mechanism = self._get_mechanism()
self.version = self._determineVersion(self.path)
self._populateInput() self._populateInput()
self._populateOutput(filename=filename) self._populateOutput(filename=filename)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment