Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix windows #2

Merged
merged 34 commits into from
Dec 27, 2023
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use subprocess to untar
  • Loading branch information
segasai committed Dec 26, 2023
commit 83f9501d4843bad19868336dc00d52325a254b68
10 changes: 7 additions & 3 deletions py/minimint/mist_interpolator.py
Original file line number Diff line number Diff line change
@@ -3,10 +3,12 @@
import glob
import os
import gc
import subprocess
import pickle
import urllib.request
import astropy.table as atpy
import scipy.interpolate

import numpy as np
from minimint import bolom, utils
"""
@@ -166,9 +168,11 @@ def writer(url, pref):
cmd = 'cd %s; tar xfJ %s' % (pref, fname)
if os.name == 'nt':
cmd = 'cd %s ; tar.exe xFJ %s' % (pref, fname)
status = os.system(cmd)
if status != 0:
raise RuntimeError('Failed to untar the files')

ret = subprocess.run(cmd, capture_output=True, shell=True)
if ret.returncode != 0:
raise RuntimeError('Failed to untar the files' +
ret.stdout.decode() + ret.stderr.decode())

with tempfile.TemporaryDirectory(dir=tmp_prefix) as T:
for curfilt in filters:
Loading