[yt-svn] commit/yt: 17 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Apr 2 15:52:29 PDT 2013


17 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/f6be5073ad1b/
Changeset:   f6be5073ad1b
Branch:      yt
User:        ngoldbaum
Date:        2013-03-28 01:34:26
Summary:     First draft of plot window answer test framework.
Affected #:  1 file

diff -r 5dcd737e56c43faf694bddd7830df42263341b5d -r f6be5073ad1befc78ba6c0985abf4ad753515780 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -36,6 +36,8 @@
 from yt.config import ytcfg
 from yt.mods import *
 from yt.data_objects.static_output import StaticOutput
+from matplotlib.testing.compare import compare_images
+import yt.visualization.plot_window as pw
 import cPickle
 import shelve
 
@@ -303,6 +305,16 @@
         obj = cls(*obj_type[1])
         return obj
 
+    def create_plot(self, pf, plot_type, plot_args, plot_kwargs = None):
+        # plot_type should be a string
+        # plot_args should be a tuple
+        # plot_kwargs should be a dict
+        if obj_type is None:
+            raise RuntimeError('Must explicitly request a plot type')
+        cls = getattr(pw, plot_type)
+        plot = cls(*plot_args, **plot_kwargs)
+        return plot
+
     @property
     def sim_center(self):
         """
@@ -547,6 +559,31 @@
         for newc, oldc in zip(new_result["children"], old_result["children"]):
             assert(newp == oldp)
 
+class PlotWindowAttributeTest(AnswerTestingTest):
+    _type_name = "PlotWindowAttribute"
+    _attrs = ('plot_args', 'attr_name', 'attr_args')
+    def __init__(self, pf_fn, plot_args, attr_name, attr_args, tolerance=1e-3)
+        super(PlotWindowAttributeTest, self).__init__(pf_fn)
+        self.plot_args = plot_args
+        self.plot_kwargs = {} # hard-coding for now.
+        self.attr_name = attr_name
+        self.attr_args = attr_args
+        self.tolerance = tolerance
+
+    def run(self):
+        plot = self.create_plot(self.pf, self.plot_type,
+                                self.plot_args, self.plot_kwargs)
+        attr = getattr(plot, self.attr_name)
+        attr(*self.attr_args)
+        return plot
+
+    def compare(self, new_result, old_result):
+        fns = []
+        fns.append(old_result.save('old'))
+        fns.append(new_result.save('new'))
+        compare_images(fns[0], fns[1], self.tolerance)
+        #for fn in fns: os.remove(fn)
+
 def requires_pf(pf_fn, big_data = False):
     def ffalse(func):
         return lambda: None


https://bitbucket.org/yt_analysis/yt/commits/92bcf02fe2e1/
Changeset:   92bcf02fe2e1
Branch:      yt
User:        ngoldbaum
Date:        2013-03-28 01:35:11
Summary:     Preventing the command line plotting tools from plotting along dummy dimensions.
Affected #:  1 file

diff -r f6be5073ad1befc78ba6c0985abf4ad753515780 -r 92bcf02fe2e1445c894277248f16b3058ce628cc yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -1292,7 +1292,9 @@
         elif args.center is None:
             center = 0.5*(pf.domain_left_edge + pf.domain_right_edge)
         center = np.array(center)
-        if args.axis == 4:
+        if pf.dimensionality < 3:
+            axes = [2]
+        elif args.axis == 4:
             axes = range(3)
         else:
             axes = [args.axis]


https://bitbucket.org/yt_analysis/yt/commits/b73721c13839/
Changeset:   b73721c13839
Branch:      yt
User:        ngoldbaum
Date:        2013-03-28 02:39:07
Summary:     Looking for decimals rather than a floating point tolerance.
Affected #:  1 file

diff -r 92bcf02fe2e1445c894277248f16b3058ce628cc -r b73721c1383941ee283d65851fc092ccfd1238d1 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -562,13 +562,13 @@
 class PlotWindowAttributeTest(AnswerTestingTest):
     _type_name = "PlotWindowAttribute"
     _attrs = ('plot_args', 'attr_name', 'attr_args')
-    def __init__(self, pf_fn, plot_args, attr_name, attr_args, tolerance=1e-3)
+    def __init__(self, pf_fn, plot_args, attr_name, attr_args, decimals=3):
         super(PlotWindowAttributeTest, self).__init__(pf_fn)
         self.plot_args = plot_args
         self.plot_kwargs = {} # hard-coding for now.
         self.attr_name = attr_name
         self.attr_args = attr_args
-        self.tolerance = tolerance
+        self.decimals = decimals
 
     def run(self):
         plot = self.create_plot(self.pf, self.plot_type,
@@ -581,7 +581,7 @@
         fns = []
         fns.append(old_result.save('old'))
         fns.append(new_result.save('new'))
-        compare_images(fns[0], fns[1], self.tolerance)
+        compare_images(fns[0], fns[1], 10**(-self.decimals))
         #for fn in fns: os.remove(fn)
 
 def requires_pf(pf_fn, big_data = False):


https://bitbucket.org/yt_analysis/yt/commits/8492c5d017b2/
Changeset:   8492c5d017b2
Branch:      yt
User:        ngoldbaum
Date:        2013-03-28 03:21:15
Summary:     Adding empty __init__.py files for directories with units tests.
This makes it easier to test only one set of unit tests.
Affected #:  5 files



https://bitbucket.org/yt_analysis/yt/commits/ea28411d2bec/
Changeset:   ea28411d2bec
Branch:      yt
User:        ngoldbaum
Date:        2013-03-28 05:20:42
Summary:     Moving some attributes from the base plot window class to PWViewerExtJS4
Affected #:  1 file
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/b08d7640f4fb/
Changeset:   b08d7640f4fb
Branch:      yt
User:        ngoldbaum
Date:        2013-03-28 06:33:10
Summary:     Finishing up plot window answer tests.  Deleting some trailing whitespace.
Affected #:  2 files
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/bbabd1d3530e/
Changeset:   bbabd1d3530e
Branch:      yt
User:        ngoldbaum
Date:        2013-03-28 07:15:31
Summary:     Fixes to get this working.  This closes #505.
Affected #:  2 files
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/432887371718/
Changeset:   432887371718
Branch:      yt
User:        ngoldbaum
Date:        2013-03-28 07:21:35
Summary:     Forgot to uncomment the line that deletes the images.
Affected #:  1 file
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/5141c3634e1b/
Changeset:   5141c3634e1b
Branch:      yt
User:        ngoldbaum
Date:        2013-03-28 19:41:12
Summary:     No longer assuming that 2D sims are in the XY plane.
Affected #:  1 file
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/300e35be7b95/
Changeset:   300e35be7b95
Branch:      yt
User:        ngoldbaum
Date:        2013-03-28 20:20:01
Summary:     No longer pickling the plot object since that is harder than expected.
We now read in the pngs saved by the plot object, pickle the numpy
array we get back, write them to disk again, and them use matplotlib
to compare.  A bit more roundabout but it seems to work.
Affected #:  2 files
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/cd985cbf5a53/
Changeset:   cd985cbf5a53
Branch:      yt
User:        ngoldbaum
Date:        2013-03-29 19:20:19
Summary:     Bumping up to ytgold0007
Affected #:  1 file
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/f31afd69216f/
Changeset:   f31afd69216f
Branch:      yt
User:        ngoldbaum
Date:        2013-03-30 11:44:24
Summary:     Making gas sloshing a big data test and removing the galaxy cluster test.
The filename in the test doesn't correspond to the dataset on yt-p.org/data
so I don't think these tests were ever run by anyone.  The dataset on the
website is huge, I don't think it should be part of the test suite.
Affected #:  1 file
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/30d55ce051fc/
Changeset:   30d55ce051fc
Branch:      yt
User:        ngoldbaum
Date:        2013-03-30 11:45:16
Summary:     Fixing up the plot window answer tests.  Adding a progress bar to
the s3 cloud upload.
Affected #:  1 file
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/3aee876d0aa4/
Changeset:   3aee876d0aa4
Branch:      yt
User:        ngoldbaum
Date:        2013-03-30 12:14:47
Summary:     Fixing deserializing the plot window answer tests.
Affected #:  1 file
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/77877b7fe6b5/
Changeset:   77877b7fe6b5
Branch:      yt
User:        ngoldbaum
Date:        2013-03-30 12:57:20
Summary:     Falling back to ASCII pickle for portability.
Affected #:  1 file
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/7208dbbf115c/
Changeset:   7208dbbf115c
Branch:      yt
User:        ngoldbaum
Date:        2013-04-02 06:55:42
Summary:     Fixing a bug I introduced in the command line modules.
Affected #:  1 file
Diff not available.

https://bitbucket.org/yt_analysis/yt/commits/73fa10cba4d5/
Changeset:   73fa10cba4d5
Branch:      yt
User:        chummels
Date:        2013-04-03 00:52:21
Summary:     Merged in ngoldbaum/yt (pull request #470)

Plot window answer testing
Affected #:  11 files
Diff not available.

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