From cbb180bfc51afc51a77c3136842311e7f1c4d4fa Mon Sep 17 00:00:00 2001 From: "Sergey E. Koposov" Date: Wed, 27 Dec 2023 01:44:03 +0000 Subject: [PATCH] further debugging --- py/minimint/mist_interpolator.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/py/minimint/mist_interpolator.py b/py/minimint/mist_interpolator.py index e515b75..8679520 100644 --- a/py/minimint/mist_interpolator.py +++ b/py/minimint/mist_interpolator.py @@ -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) @@ -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())