[Yt-svn] commit/yt: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Wed May 11 22:39:26 PDT 2011


2 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/a9316af91628/
changeset:   r4249:a9316af91628
branch:      yt
user:        Cameron Hummels
date:        2011-05-12 07:37:25
summary:     Added an exception to handle when the test_runner looks to compare a test output against the gold standard and the standard is missing.  This allows the test_runner to fail the test, instead of bailing on the entire run.
affected #:  1 file (429 bytes)

--- a/yt/utilities/answer_testing/runner.py	Wed May 11 11:30:17 2011 -0400
+++ b/yt/utilities/answer_testing/runner.py	Thu May 12 01:37:25 2011 -0400
@@ -36,6 +36,14 @@
 def clear_registry():
     test_registry.clear()
 
+class FileNotExistException(Exception):
+    def __init__(self, filename):
+        self.filename = filename
+
+    def __repr__(self):
+        return "FileNotExistException: %s" % (self.filename)
+
+
 class RegressionTestStorage(object):
     def __init__(self, results_id, path = "."):
         self.id = results_id
@@ -58,6 +66,8 @@
         f.close()
 
     def __getitem__(self, test_name):
+        if not os.path.exists(self._fn(test_name)):
+            raise FileNotExistException(self._fn(test_name))
         f = open(self._fn(test_name), "rb")
         tr = cPickle.load(f)
         f.close()
@@ -128,7 +138,10 @@
     def _compare(self, test):
         if self.old_results is None:
             return (True, "New Test")
-        old_result = self.old_results[test.name]
+        try:
+            old_result = self.old_results[test.name]
+        except FileNotExistException:
+            return (False, "File %s does not exist." % test.name)
         try:
             test.compare(old_result)
         except RegressionTestException, exc:


http://bitbucket.org/yt_analysis/yt/changeset/19acf4efe16b/
changeset:   r4250:19acf4efe16b
branch:      yt
user:        Cameron Hummels
date:        2011-05-12 07:38:42
summary:     Added _scale_image function to the api for visualization and to yt.mods.  It's a useful function for scaling image arrays so they can be used by matplotlib and other utils.
affected #:  2 files (34 bytes)

--- a/yt/mods.py	Thu May 12 01:37:25 2011 -0400
+++ b/yt/mods.py	Thu May 12 01:38:42 2011 -0400
@@ -96,7 +96,7 @@
     PlotCollection, PlotCollectionInteractive, \
     get_multi_plot, FixedResolutionBuffer, ObliqueFixedResolutionBuffer, \
     callback_registry, write_bitmap, write_image, annotate_image, \
-    apply_colormap
+    apply_colormap, _scale_image
 
 from yt.visualization.volume_rendering.api import \
     ColorTransferFunction, PlanckTransferFunction, ProjectionTransferFunction, \


--- a/yt/visualization/api.py	Thu May 12 01:37:25 2011 -0400
+++ b/yt/visualization/api.py	Thu May 12 01:38:42 2011 -0400
@@ -48,7 +48,8 @@
     map_to_colors, \
     splat_points, \
     annotate_image, \
-    apply_colormap
+    apply_colormap, \
+    _scale_image
 
 from plot_modifications import \
     PlotCallback, \

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