[yt-svn] commit/yt: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Nov 29 07:42:35 PST 2017
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/e90d4516fe6a/
Changeset: e90d4516fe6a
User: ngoldbaum
Date: 2017-10-27 16:57:27+00:00
Summary: Delete unnecessary color_stride attribute of CoordinateVectorSource.
Closes #1595.
Affected #: 1 file
diff -r 7da7f5e19cdd525f64c9d3c1fa5e46a59d80f59d -r e90d4516fe6a67f40285e11040e3a20b832c8414 yt/visualization/volume_rendering/render_source.py
--- a/yt/visualization/volume_rendering/render_source.py
+++ b/yt/visualization/volume_rendering/render_source.py
@@ -1240,7 +1240,6 @@
colors[2, 2] = 1.0 # z is blue
colors[:, 3] = alpha
self.colors = colors
- self.color_stride = 2
def render(self, camera, zbuffer=None):
"""Renders an image using the provided camera
@@ -1321,15 +1320,14 @@
py = py.astype('int64')
if len(px.shape) == 1:
- zlines(empty, z, px, py, dz, self.colors.astype('float64'),
- self.color_stride)
+ zlines(empty, z, px, py, dz, self.colors.astype('float64'))
else:
# For stereo-lens, two sets of pos for each eye are contained
# in px...pz
zlines(empty, z, px[0, :], py[0, :], dz[0, :],
- self.colors.astype('float64'), self.color_stride)
+ self.colors.astype('float64'))
zlines(empty, z, px[1, :], py[1, :], dz[1, :],
- self.colors.astype('float64'), self.color_stride)
+ self.colors.astype('float64'))
# Set the new zbuffer
self.zbuffer = zbuffer
https://bitbucket.org/yt_analysis/yt/commits/f2b913d6ddca/
Changeset: f2b913d6ddca
User: ngoldbaum
Date: 2017-10-27 17:15:31+00:00
Summary: add a test for #1595
Affected #: 1 file
diff -r e90d4516fe6a67f40285e11040e3a20b832c8414 -r f2b913d6ddcaccc0cfdcbe6b98c8eeaa0e26a053 yt/visualization/volume_rendering/tests/test_scene.py
--- a/yt/visualization/volume_rendering/tests/test_scene.py
+++ b/yt/visualization/volume_rendering/tests/test_scene.py
@@ -18,8 +18,12 @@
import shutil
from yt.testing import \
fake_random_ds, \
- assert_fname
-from yt.visualization.volume_rendering.api import volume_render, VolumeSource
+ assert_fname, \
+ fake_vr_orientation_test_ds
+from yt.visualization.volume_rendering.api import \
+ create_scene, \
+ volume_render, \
+ VolumeSource
import numpy as np
from unittest import TestCase
@@ -90,3 +94,15 @@
sc.camera.pitch(2*np.pi/nrot)
sc.render()
sc.save('test_rot_%04i.png' % i, sigma_clip=6.0)
+
+def test_annotations():
+ ds = fake_vr_orientation_test_ds(N=16)
+ sc = create_scene(ds)
+ sc.annotate_axes()
+ sc.annotate_domain(ds)
+ sc.render()
+ # ensure that there are actually red, green, blue, and white pixels
+ # in the image. see Issue #1595
+ im = sc._last_render
+ for c in ([1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 1], [1, 1, 1, 1]):
+ assert np.where((im == c).all(axis=-1))[0].shape[0] > 0
https://bitbucket.org/yt_analysis/yt/commits/33b9af9222cf/
Changeset: 33b9af9222cf
User: xarthisius
Date: 2017-11-29 15:42:22+00:00
Summary: Merge pull request #1596 from ngoldbaum/vr-axes-colors
Fix volume rendering annotate_axes axes colors.
Affected #: 2 files
diff -r f6279767c26ef709cd0a53611867ab59621a3faf -r 33b9af9222cfd060e54070839a20d731bdb12bb0 yt/visualization/volume_rendering/render_source.py
--- a/yt/visualization/volume_rendering/render_source.py
+++ b/yt/visualization/volume_rendering/render_source.py
@@ -1240,7 +1240,6 @@
colors[2, 2] = 1.0 # z is blue
colors[:, 3] = alpha
self.colors = colors
- self.color_stride = 2
def render(self, camera, zbuffer=None):
"""Renders an image using the provided camera
@@ -1321,15 +1320,14 @@
py = py.astype('int64')
if len(px.shape) == 1:
- zlines(empty, z, px, py, dz, self.colors.astype('float64'),
- self.color_stride)
+ zlines(empty, z, px, py, dz, self.colors.astype('float64'))
else:
# For stereo-lens, two sets of pos for each eye are contained
# in px...pz
zlines(empty, z, px[0, :], py[0, :], dz[0, :],
- self.colors.astype('float64'), self.color_stride)
+ self.colors.astype('float64'))
zlines(empty, z, px[1, :], py[1, :], dz[1, :],
- self.colors.astype('float64'), self.color_stride)
+ self.colors.astype('float64'))
# Set the new zbuffer
self.zbuffer = zbuffer
diff -r f6279767c26ef709cd0a53611867ab59621a3faf -r 33b9af9222cfd060e54070839a20d731bdb12bb0 yt/visualization/volume_rendering/tests/test_scene.py
--- a/yt/visualization/volume_rendering/tests/test_scene.py
+++ b/yt/visualization/volume_rendering/tests/test_scene.py
@@ -18,8 +18,12 @@
import shutil
from yt.testing import \
fake_random_ds, \
- assert_fname
-from yt.visualization.volume_rendering.api import volume_render, VolumeSource
+ assert_fname, \
+ fake_vr_orientation_test_ds
+from yt.visualization.volume_rendering.api import \
+ create_scene, \
+ volume_render, \
+ VolumeSource
import numpy as np
from unittest import TestCase
@@ -90,3 +94,15 @@
sc.camera.pitch(2*np.pi/nrot)
sc.render()
sc.save('test_rot_%04i.png' % i, sigma_clip=6.0)
+
+def test_annotations():
+ ds = fake_vr_orientation_test_ds(N=16)
+ sc = create_scene(ds)
+ sc.annotate_axes()
+ sc.annotate_domain(ds)
+ sc.render()
+ # ensure that there are actually red, green, blue, and white pixels
+ # in the image. see Issue #1595
+ im = sc._last_render
+ for c in ([1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 1], [1, 1, 1, 1]):
+ assert np.where((im == c).all(axis=-1))[0].shape[0] > 0
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