[yt-svn] commit/yt: MatthewTurk: Adding the ability to pass in pf_fn as a pf, and a requires_output_log

Bitbucket commits-noreply at bitbucket.org
Wed Nov 7 11:41:22 PST 2012


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/7f4089b10365/
changeset:   7f4089b10365
branch:      yt
user:        MatthewTurk
date:        2012-11-07 20:41:06
summary:     Adding the ability to pass in pf_fn as a pf, and a requires_output_log
decorator.
affected #:  1 file

diff -r 71f6d234a15c686aef3c04b6967d3e095fe373d3 -r 7f4089b10365fec94474e06b07a98892298f3233 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -132,6 +132,8 @@
 
 def can_run_pf(pf_fn):
     path = ytcfg.get("yt", "test_data_dir")
+    if isinstance(pf_fn, StaticOutput):
+        return AnswerTestingTest.result_storage is not None
     with temp_cwd(path):
         try:
             load(pf_fn)
@@ -141,6 +143,7 @@
 
 def data_dir_load(pf_fn):
     path = ytcfg.get("yt", "test_data_dir")
+    if isinstance(pf_fn, StaticOutput): return pf
     with temp_cwd(path):
         pf = load(pf_fn)
         pf.h
@@ -353,6 +356,15 @@
         for newc, oldc in zip(new_result["children"], old_result["children"]):
             assert(newp == oldp)
 
+def requires_outputlog():
+    def ffalse(func):
+        return lambda: None
+    def ftrue(func):
+        return func
+    if os.path.exists("OutputLog"):
+        return ftrue
+    return ffalse
+
 def requires_pf(pf_fn, big_data = False):
     def ffalse(func):
         return lambda: None

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

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