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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Jul 29 14:09:19 PDT 2015


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/f7f24b292e10/
Changeset:   f7f24b292e10
Branch:      yt
User:        xarthisius
Date:        2015-07-28 19:23:18+00:00
Summary:     Rewrite test_filters to get rid of another race condition in nose, run tests only if scipy is installed
Affected #:  1 file

diff -r dcf3ad46296da7df8ad77a2501e09d6bc7e429a4 -r f7f24b292e1066b3da27f31d49029d18b8eceeb5 yt/visualization/tests/test_filters.py
--- a/yt/visualization/tests/test_filters.py
+++ b/yt/visualization/tests/test_filters.py
@@ -10,28 +10,23 @@
 
 """
 
-from yt.testing import fake_amr_ds
+from yt.testing import fake_amr_ds, requires_module
 
 
-class TestFilters():
+ at requires_module("scipy")
+def test_white_noise_filter(self):
+    ds = fake_amr_ds(fields=("density",))
+    p = ds.proj("density", "z")
+    frb = p.to_frb((1, 'unitary'), 64)
+    frb.apply_white_noise()
+    frb.apply_white_noise(1e-3)
+    frb["density"]
 
-    @classmethod
-    def setup_class(cls):
-        ds = fake_amr_ds(fields=("density",))
-        p = ds.proj("density", "z")
-        cls.frb = p.to_frb((1, 'unitary'), 64)
 
-    def teardown(self):
-        try:
-            del self.frb["density"]
-        except KeyError:
-            pass
-
-    def test_white_noise_filter(self):
-        self.frb.apply_white_noise()
-        self.frb.apply_white_noise(1e-3)
-        self.frb["density"]
-
-    def test_gauss_beam_filter(self):
-        self.frb.apply_gauss_beam(nbeam=15, sigma=1.0)
-        self.frb["density"]
+ at requires_module("scipy")
+def test_gauss_beam_filter(self):
+    ds = fake_amr_ds(fields=("density",))
+    p = ds.proj("density", "z")
+    frb = p.to_frb((1, 'unitary'), 64)
+    frb.apply_gauss_beam(nbeam=15, sigma=1.0)
+    frb["density"]


https://bitbucket.org/yt_analysis/yt/commits/6a7cea16e86c/
Changeset:   6a7cea16e86c
Branch:      yt
User:        xarthisius
Date:        2015-07-28 19:35:58+00:00
Summary:     Require astropy to be installed for fits' tests
Affected #:  1 file

diff -r f7f24b292e1066b3da27f31d49029d18b8eceeb5 -r 6a7cea16e86c8c4e497f850921ae1114511f156a yt/utilities/tests/test_fits_image.py
--- a/yt/utilities/tests/test_fits_image.py
+++ b/yt/utilities/tests/test_fits_image.py
@@ -17,7 +17,7 @@
 import os
 import numpy as np
 import shutil
-from yt.testing import fake_random_ds
+from yt.testing import fake_random_ds, requires_module
 from yt.convenience import load
 from numpy.testing import \
     assert_equal
@@ -29,6 +29,8 @@
 from yt.visualization.volume_rendering.camera import \
     off_axis_projection
 
+
+ at requires_module("astropy")
 def test_fits_image():
     tmpdir = tempfile.mkdtemp()
     curdir = os.getcwd()
@@ -87,7 +89,7 @@
     cut_frb = cut.to_frb((0.5, "unitary"), 128)
 
     fid3 = FITSImageData(cut_frb, fields=["density","temperature"], units="cm")
-    fits_cut = FITSOffAxisSlice(ds, [0.1, 0.2, -0.9], ["density","temperature"], 
+    fits_cut = FITSOffAxisSlice(ds, [0.1, 0.2, -0.9], ["density","temperature"],
                                 image_res=128, center=[0.5, 0.42, 0.6],
                                 width=(0.5,"unitary"))
 
@@ -103,26 +105,26 @@
     assert new_fid3.wcs.wcs.ctype[0] == "RA---TAN"
     assert new_fid3.wcs.wcs.ctype[1] == "DEC--TAN"
 
-    buf = off_axis_projection(ds, ds.domain_center, [0.1, 0.2, -0.9], 
+    buf = off_axis_projection(ds, ds.domain_center, [0.1, 0.2, -0.9],
                               0.5, 128, "density").swapaxes(0, 1)
     fid4 = FITSImageData(buf, fields="density", width=100.0)
-    fits_oap = FITSOffAxisProjection(ds, [0.1, 0.2, -0.9], "density", 
-                                     width=(0.5,"unitary"), image_res=128, 
+    fits_oap = FITSOffAxisProjection(ds, [0.1, 0.2, -0.9], "density",
+                                     width=(0.5,"unitary"), image_res=128,
                                      depth_res=128, depth=(0.5,"unitary"))
 
     yield assert_equal, fid4.get_data("density"), fits_oap.get_data("density")
 
-    cvg = ds.covering_grid(ds.index.max_level, [0.25,0.25,0.25], 
+    cvg = ds.covering_grid(ds.index.max_level, [0.25,0.25,0.25],
                            [32, 32, 32], fields=["density","temperature"])
     fid5 = FITSImageData(cvg, fields=["density","temperature"])
     assert fid5.dimensionality == 3
 
     fid5.update_header("density", "time", 0.1)
     fid5.update_header("all", "units", "cgs")
-    
+
     assert fid5["density"].header["time"] == 0.1
     assert fid5["temperature"].header["units"] == "cgs"
     assert fid5["density"].header["units"] == "cgs"
-    
+
     os.chdir(curdir)
     shutil.rmtree(tmpdir)


https://bitbucket.org/yt_analysis/yt/commits/382b5e4f9adb/
Changeset:   382b5e4f9adb
Branch:      yt
User:        xarthisius
Date:        2015-07-28 19:36:10+00:00
Summary:     Fix test_filters definitions
Affected #:  1 file

diff -r 6a7cea16e86c8c4e497f850921ae1114511f156a -r 382b5e4f9adb5859c10a4d172eb535becc402a4e yt/visualization/tests/test_filters.py
--- a/yt/visualization/tests/test_filters.py
+++ b/yt/visualization/tests/test_filters.py
@@ -14,7 +14,7 @@
 
 
 @requires_module("scipy")
-def test_white_noise_filter(self):
+def test_white_noise_filter():
     ds = fake_amr_ds(fields=("density",))
     p = ds.proj("density", "z")
     frb = p.to_frb((1, 'unitary'), 64)
@@ -24,7 +24,7 @@
 
 
 @requires_module("scipy")
-def test_gauss_beam_filter(self):
+def test_gauss_beam_filter():
     ds = fake_amr_ds(fields=("density",))
     p = ds.proj("density", "z")
     frb = p.to_frb((1, 'unitary'), 64)


https://bitbucket.org/yt_analysis/yt/commits/b35ac81530d4/
Changeset:   b35ac81530d4
Branch:      yt
User:        ngoldbaum
Date:        2015-07-29 21:09:10+00:00
Summary:     Merged in xarthisius/yt (pull request #1660)

Prevent unittest from failure if astropy/scipy is not installed
Affected #:  2 files

diff -r 6c6b39d2fe53a28aa99acb516ca28f51cdf77e3f -r b35ac81530d482ef95fd62caec0c018207a41b47 yt/utilities/tests/test_fits_image.py
--- a/yt/utilities/tests/test_fits_image.py
+++ b/yt/utilities/tests/test_fits_image.py
@@ -17,7 +17,7 @@
 import os
 import numpy as np
 import shutil
-from yt.testing import fake_random_ds
+from yt.testing import fake_random_ds, requires_module
 from yt.convenience import load
 from numpy.testing import \
     assert_equal
@@ -29,6 +29,8 @@
 from yt.visualization.volume_rendering.camera import \
     off_axis_projection
 
+
+ at requires_module("astropy")
 def test_fits_image():
     tmpdir = tempfile.mkdtemp()
     curdir = os.getcwd()
@@ -87,7 +89,7 @@
     cut_frb = cut.to_frb((0.5, "unitary"), 128)
 
     fid3 = FITSImageData(cut_frb, fields=["density","temperature"], units="cm")
-    fits_cut = FITSOffAxisSlice(ds, [0.1, 0.2, -0.9], ["density","temperature"], 
+    fits_cut = FITSOffAxisSlice(ds, [0.1, 0.2, -0.9], ["density","temperature"],
                                 image_res=128, center=[0.5, 0.42, 0.6],
                                 width=(0.5,"unitary"))
 
@@ -103,26 +105,26 @@
     assert new_fid3.wcs.wcs.ctype[0] == "RA---TAN"
     assert new_fid3.wcs.wcs.ctype[1] == "DEC--TAN"
 
-    buf = off_axis_projection(ds, ds.domain_center, [0.1, 0.2, -0.9], 
+    buf = off_axis_projection(ds, ds.domain_center, [0.1, 0.2, -0.9],
                               0.5, 128, "density").swapaxes(0, 1)
     fid4 = FITSImageData(buf, fields="density", width=100.0)
-    fits_oap = FITSOffAxisProjection(ds, [0.1, 0.2, -0.9], "density", 
-                                     width=(0.5,"unitary"), image_res=128, 
+    fits_oap = FITSOffAxisProjection(ds, [0.1, 0.2, -0.9], "density",
+                                     width=(0.5,"unitary"), image_res=128,
                                      depth_res=128, depth=(0.5,"unitary"))
 
     yield assert_equal, fid4.get_data("density"), fits_oap.get_data("density")
 
-    cvg = ds.covering_grid(ds.index.max_level, [0.25,0.25,0.25], 
+    cvg = ds.covering_grid(ds.index.max_level, [0.25,0.25,0.25],
                            [32, 32, 32], fields=["density","temperature"])
     fid5 = FITSImageData(cvg, fields=["density","temperature"])
     assert fid5.dimensionality == 3
 
     fid5.update_header("density", "time", 0.1)
     fid5.update_header("all", "units", "cgs")
-    
+
     assert fid5["density"].header["time"] == 0.1
     assert fid5["temperature"].header["units"] == "cgs"
     assert fid5["density"].header["units"] == "cgs"
-    
+
     os.chdir(curdir)
     shutil.rmtree(tmpdir)

diff -r 6c6b39d2fe53a28aa99acb516ca28f51cdf77e3f -r b35ac81530d482ef95fd62caec0c018207a41b47 yt/visualization/tests/test_filters.py
--- a/yt/visualization/tests/test_filters.py
+++ b/yt/visualization/tests/test_filters.py
@@ -10,28 +10,23 @@
 
 """
 
-from yt.testing import fake_amr_ds
+from yt.testing import fake_amr_ds, requires_module
 
 
-class TestFilters():
+ at requires_module("scipy")
+def test_white_noise_filter():
+    ds = fake_amr_ds(fields=("density",))
+    p = ds.proj("density", "z")
+    frb = p.to_frb((1, 'unitary'), 64)
+    frb.apply_white_noise()
+    frb.apply_white_noise(1e-3)
+    frb["density"]
 
-    @classmethod
-    def setup_class(cls):
-        ds = fake_amr_ds(fields=("density",))
-        p = ds.proj("density", "z")
-        cls.frb = p.to_frb((1, 'unitary'), 64)
 
-    def teardown(self):
-        try:
-            del self.frb["density"]
-        except KeyError:
-            pass
-
-    def test_white_noise_filter(self):
-        self.frb.apply_white_noise()
-        self.frb.apply_white_noise(1e-3)
-        self.frb["density"]
-
-    def test_gauss_beam_filter(self):
-        self.frb.apply_gauss_beam(nbeam=15, sigma=1.0)
-        self.frb["density"]
+ at requires_module("scipy")
+def test_gauss_beam_filter():
+    ds = fake_amr_ds(fields=("density",))
+    p = ds.proj("density", "z")
+    frb = p.to_frb((1, 'unitary'), 64)
+    frb.apply_gauss_beam(nbeam=15, sigma=1.0)
+    frb["density"]

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