Skip to content

Commit

Permalink
update simulatio.py to get output without simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidChoi76 committed Dec 11, 2018
1 parent 6716ba3 commit d78a30b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pysumma/Simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def execute(self, run_option, run_suffix, specworker_img = None):
" -v {}:{}".format(self.output_path.filepath, self.output_path.filepath) + \
" {} -p never -s {} -m {}".format(self.executable, self.run_suffix, self.filepath)
# run shell script in python and print output
print(cmd)
cmd = shlex.split(cmd)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
output = p.communicate()[0].decode('utf-8')
Expand Down Expand Up @@ -178,8 +179,7 @@ def execute(self, run_option, run_suffix, specworker_img = None):
def get_output(self, version, output_prefix=None, run_suffix=None):
if version == "cuahsi_sopron":
out_file_path = self.base_dir + '/' + self.output_path.filepath.split('/')[1] + '/' + \
output_prefix + '_output_' + \
self.run_suffix + 'timestep.nc'
output_prefix + '_output_' + 'timestep.nc'
xr_output = xr.open_dataset(out_file_path)
elif version == "cuahsi_master":
out_file_path = self.base_dir + self.output_path.value.split('>')[1] + \
Expand Down

0 comments on commit d78a30b

Please sign in to comment.