Skip to content

Commit

Permalink
further debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
segasai committed Dec 27, 2023
1 parent 95a6b52 commit cbb180b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions py/minimint/mist_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ def getheader(f):


def read_grid(eep_prefix, outp_prefix):
fs = glob.glob(os.path.join(eep_prefix, '*EEPS', '*eep'))
assert (len(fs) > 0)
mask = os.path.join(eep_prefix, '*EEPS', '*eep')
fs = glob.glob(mask)
if len(fs) == 0:
raise RuntimeError(f'Failed to find eep files {mask}')
tmpfile = utils.tail_head(fs[0], 11, 10)
tab0 = atpy.Table().read(tmpfile, format='ascii.fast_commented_header')
os.unlink(tmpfile)
Expand Down Expand Up @@ -168,12 +170,14 @@ def writer(url, pref):
fd.close()
if os.name == 'nt':
fname_out1 = fname_out.replace('.txz', '.tar')
cmd = f'cd {pref} && 7z x {fname_out} -so > {fname_out1} && tar -xf {fname_out1}'
cmd = (f'cd {pref} && '
f'7z x {fname_out} -so > {fname_out1} && '
f'tar -xf {fname_out1}')
else:
cmd = f'cd {pref}; tar xfJ {fname_out}'
#ret = subprocess.run(cmd, capture_output=True, shell=True, timeout=60)
ret = subprocess.run(cmd, shell=True, timeout=60)
print(fname_out, fname_out1)
ret = subprocess.run(cmd, capture_output=True, shell=True, timeout=60)
# ret = subprocess.run(cmd, shell=True, timeout=60)
if ret.returncode != 0:
raise RuntimeError('Failed to untar the files' +
ret.stdout.decode() + ret.stderr.decode())
Expand Down

0 comments on commit cbb180b

Please sign in to comment.