[yt-svn] commit/yt-doc: 4 new changesets
Bitbucket
commits-noreply at bitbucket.org
Thu Feb 21 11:14:24 PST 2013
4 new commits in yt-doc:
https://bitbucket.org/yt_analysis/yt-doc/commits/425ff66d39e9/
changeset: 425ff66d39e9
user: xarthisius
date: 2013-02-21 19:44:58
summary: Add cookbook receipes' driver with mulitprocessing capability
affected #: 1 file
diff -r cf2a0d00c9c298c2291382f403417af8c32906c1 -r 425ff66d39e9195964ac8de1dbf51ffcaca51847 helper_scripts/run_recipes.py
--- /dev/null
+++ b/helper_scripts/run_recipes.py
@@ -0,0 +1,62 @@
+#!/usr/bin/python
+
+import os
+import glob
+import sys
+import shutil
+import tempfile
+from multiprocessing import Pool
+from yt.config import ytcfg
+
+FPATTERNS = ['*.png', '*.txt', '*.h5', '*.dat']
+DPATTERNS = ['LC*', 'LR', 'DD0046', 'halo_analysis']
+CWD = os.getcwd()
+DIR = 'source/cookbook/_static'
+DESTDIR = os.path.join(CWD, DIR)
+NEEDS_SERIAL = ["light_cone_with_halo_mask"]
+
+
+def prep_dirs():
+ for directory in glob.glob('%s/*' % ytcfg.get("yt", "test_data_dir")):
+ os.symlink(directory, os.path.basename(directory))
+
+
+def run_receipe((receipe,)):
+ module_name, ext = os.path.splitext(os.path.basename(receipe))
+ if not os.path.exists("%s/_temp/%s.done" % (CWD, module_name)):
+ if module_name in NEEDS_SERIAL:
+ ytcfg["yt", "serialize"] = "False"
+ else:
+ ytcfg["yt", "serialize"] = "False"
+ sys.stderr.write('Started %s\n' % module_name)
+ cwd = os.getcwd()
+ tmpdir = tempfile.mkdtemp()
+ os.chdir(tmpdir)
+ prep_dirs()
+ module = __import__(module_name)
+ open("%s/_temp/%s.done" % (CWD, module_name), 'wb').close()
+ for pattern in FPATTERNS:
+ for fname in glob.glob(pattern):
+ dst = os.path.join(DESTDIR, module_name)
+ shutil.move(fname, "%s__%s" % (dst, fname))
+ for pattern in DPATTERNS:
+ for dname in glob.glob(pattern):
+ dst = os.path.join(DESTDIR, module_name)
+ shutil.move(dname, dst)
+ os.chdir(cwd)
+ shutil.rmtree(tmpdir, True)
+ sys.stderr.write('Finished with %s\n' % module_name)
+ return 0
+
+for path in ['_temp', DESTDIR]:
+ if os.path.exists(path):
+ shutil.rmtree(path)
+ os.makedirs(path)
+
+os.chdir('_temp')
+sys.path.append(os.path.join(CWD, 'source/cookbook'))
+WPOOL = Pool(processes=8)
+RES = WPOOL.map_async(run_receipe, (
+ (receipe,) for receipe in glob.glob('%s/*.py' % sys.path[-1])))
+RES.get()
+os.chdir(CWD)
https://bitbucket.org/yt_analysis/yt-doc/commits/04307206cba4/
changeset: 04307206cba4
user: xarthisius
date: 2013-02-21 19:51:12
summary: [run_recipes] fix typo
affected #: 1 file
diff -r 425ff66d39e9195964ac8de1dbf51ffcaca51847 -r 04307206cba4caee6913938d26753a2dc89b6472 helper_scripts/run_recipes.py
--- a/helper_scripts/run_recipes.py
+++ b/helper_scripts/run_recipes.py
@@ -27,7 +27,7 @@
if module_name in NEEDS_SERIAL:
ytcfg["yt", "serialize"] = "False"
else:
- ytcfg["yt", "serialize"] = "False"
+ ytcfg["yt", "serialize"] = "True"
sys.stderr.write('Started %s\n' % module_name)
cwd = os.getcwd()
tmpdir = tempfile.mkdtemp()
https://bitbucket.org/yt_analysis/yt-doc/commits/4d87b0228cb2/
changeset: 4d87b0228cb2
user: xarthisius
date: 2013-02-21 20:01:41
summary: Disable projection serialization for all tests
affected #: 1 file
diff -r 04307206cba4caee6913938d26753a2dc89b6472 -r 4d87b0228cb2a5ea08a83dc846166ef1d6a6e1b8 helper_scripts/run_recipes.py
--- a/helper_scripts/run_recipes.py
+++ b/helper_scripts/run_recipes.py
@@ -13,7 +13,8 @@
CWD = os.getcwd()
DIR = 'source/cookbook/_static'
DESTDIR = os.path.join(CWD, DIR)
-NEEDS_SERIAL = ["light_cone_with_halo_mask"]
+#NEEDS_SERIAL = ["light_cone_with_halo_mask"]
+ytcfg["yt", "serialize"] = "False"
def prep_dirs():
@@ -24,10 +25,6 @@
def run_receipe((receipe,)):
module_name, ext = os.path.splitext(os.path.basename(receipe))
if not os.path.exists("%s/_temp/%s.done" % (CWD, module_name)):
- if module_name in NEEDS_SERIAL:
- ytcfg["yt", "serialize"] = "False"
- else:
- ytcfg["yt", "serialize"] = "True"
sys.stderr.write('Started %s\n' % module_name)
cwd = os.getcwd()
tmpdir = tempfile.mkdtemp()
https://bitbucket.org/yt_analysis/yt-doc/commits/f115d10758f7/
changeset: f115d10758f7
user: xarthisius
date: 2013-02-21 20:03:37
summary: Drop obsolete run_recipes.sh
affected #: 1 file
diff -r 4d87b0228cb2a5ea08a83dc846166ef1d6a6e1b8 -r f115d10758f79d1780cc7335e4571a3e68446303 helper_scripts/run_recipes.sh
--- a/helper_scripts/run_recipes.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-ROOT=`pwd`
-
-if [ ! -e source/cookbook/_static ]; then
- mkdir source/cookbook/_static
-fi
-
-for s in source/cookbook/*.py
-do
- sb=`basename ${s}`
- cd ${ROOT}/_temp/
- [ -e ${sb}.done ] && continue
- echo ${sb}
- python2.7 ${ROOT}/${s} --config serialize=false || exit
- for o in *.png *.txt *.h5 *.dat
- do
- if [ -f ${o} ]; then
- mv -v ${ROOT}/_temp/${o} ${ROOT}/source/cookbook/_static/${sb%%.py}__${o}
- fi
- done
- for o in LC LC_HM LC_U LR halo_analysis DD0046
- do
- if [ -d ${o} ]; then
- mv -v ${ROOT}/_temp/${o} ${ROOT}/source/cookbook/_static/${sb%%.py}__`basename ${o}`
- fi
- done
- touch ${sb}.done
- echo ${sb}.done
-done
\ No newline at end of file
Repository URL: https://bitbucket.org/yt_analysis/yt-doc/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list