[Yt-svn] yt: added basename keyword for all_pfs() so you can use it in a ...
hg at spacepope.org
hg at spacepope.org
Wed Oct 20 17:04:18 PDT 2010
hg Repository: yt
details: yt/rev/117b4d2476be
changeset: 3452:117b4d2476be
user: J.S. Oishi <jsoishi at gmail.com>
date:
Wed Oct 20 17:04:01 2010 -0700
description:
added basename keyword for all_pfs() so you can use it in a directory that does not itself contain the parameter files
diffstat:
yt/convenience.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (15 lines):
diff -r 33bc244f64c0 -r 117b4d2476be yt/convenience.py
--- a/yt/convenience.py Mon Oct 18 09:27:17 2010 -0500
+++ b/yt/convenience.py Wed Oct 20 17:04:01 2010 -0700
@@ -41,9 +41,10 @@
passed on to the EnzoStaticOutput constructor.
"""
list_of_names = []
+ basedir = os.path.expanduser(basedir)
for i in range(max_depth):
bb = list('*' * i) + [name_spec]
- list_of_names += glob.glob(os.path.join(*bb))
+ list_of_names += glob.glob(os.path.join(basedir,*bb))
list_of_names.sort(key=lambda b: os.path.basename(b))
for fn in list_of_names:
yield load(fn[:-10], **kwargs)
More information about the yt-svn
mailing list