[yt-svn] commit/yt: ngoldbaum: Merged in xarthisius/yt (pull request #1660)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Jul 29 14:09:21 PDT 2015
1 new commit in yt:
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