From 8bb1ab657e5005f2a54f44d4f01644d2723f64d6 Mon Sep 17 00:00:00 2001 From: Jordan Mirocha Date: Thu, 23 Jun 2016 11:34:48 -0700 Subject: [PATCH 1/3] updated remote.py to allow one to DL only specific files --- input/litdata/eldridge2009.py | 2 +- remote.py | 30 ++++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/input/litdata/eldridge2009.py b/input/litdata/eldridge2009.py index 776d72dd9..ba6301979 100644 --- a/input/litdata/eldridge2009.py +++ b/input/litdata/eldridge2009.py @@ -45,7 +45,7 @@ def _kwargs_to_fn(**kwargs): """ Determine filename of appropriate BPASS lookup table based on kwargs. """ - + # All files share this prefix fn = 'sed.bpass' diff --git a/remote.py b/remote.py index 8d9dc4aab..c1ff4667f 100644 --- a/remote.py +++ b/remote.py @@ -39,19 +39,39 @@ os.chdir('input') -if 'minimal' in options: - to_download = ['inits', 'secondary_electrons'] +files = [] +if len(options) > 0: + if 'minimal' in options: + to_download = ['inits', 'secondary_electrons'] + files = [None, None] + else: + to_download = [] + for key in options: + if re.search(':', key): + pre, post = key.split(':') + to_download.append(pre) + files.append(int(post)) + else: + to_download.append(key) + files.append(None) else: to_download = aux_data.keys() + files = [None] * len(to_download) -for direc in to_download: +for i, direc in enumerate(to_download): if not os.path.exists(direc): os.mkdir(direc) os.chdir(direc) web = aux_data[direc][0] - for fn in aux_data[direc][1:-1]: + + if files[i] is None: + fns = aux_data[direc][1:-1] + else: + fns = [aux_data[direc][1:-1][files[i]]] + + for fn in fns: if os.path.exists(fn): if 'fresh' or 'clean' in options: @@ -63,9 +83,11 @@ print "Downloading %s/%s..." % (web, fn) urllib.urlretrieve('%s/%s' % (web, fn), fn) + # If it's not a tarball, move on if not re.search('tar', fn): continue + # Otherwise, unpack it tar = tarfile.open(fn) tar.extractall() tar.close() From 7e69c8f469c4b63d9ff565b5859a9e3ea32a63b6 Mon Sep 17 00:00:00 2001 From: Jordan Mirocha Date: Mon, 27 Jun 2016 09:41:01 -0700 Subject: [PATCH 2/3] fixed unresolved changes in merge --- ares/physics/Hydrogen.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ares/physics/Hydrogen.py b/ares/physics/Hydrogen.py index ffd2f507b..8c8e60cad 100644 --- a/ares/physics/Hydrogen.py +++ b/ares/physics/Hydrogen.py @@ -59,13 +59,7 @@ c1 = 4. * np.pi / 3. / np.sqrt(3.) / g23 c2 = 8. * np.pi / 3. / np.sqrt(3.) / g13 -<<<<<<< local -class Hydrogen: - def __init__(self, cosm=None, **kwargs): - - self.pf = ParameterFile(**kwargs) - -======= + class Hydrogen(object): def __init__(self, cosm=None, **kwargs): From f60a3da6be111b7780eda5bfa9e6122a2933bfda Mon Sep 17 00:00:00 2001 From: Jordan Mirocha Date: Mon, 27 Jun 2016 23:36:25 +0000 Subject: [PATCH 3/3] Fixed bug that occurs when tanh_model=False passed to ModelGrid --- ares/inference/ModelGrid.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ares/inference/ModelGrid.py b/ares/inference/ModelGrid.py index 40b1dafdb..58da16046 100644 --- a/ares/inference/ModelGrid.py +++ b/ares/inference/ModelGrid.py @@ -48,6 +48,8 @@ def tanh(self): if 'tanh_model' in self.base_kwargs: if self.base_kwargs['tanh_model']: self._tanh = True + else: + self._tanh = False else: self._tanh = False return self._tanh