[yt-svn] commit/yt: xarthisius: Merged in ngoldbaum/yt (pull request #2359)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Sep 7 11:19:45 PDT 2016
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/2f4fbeb0ac27/
Changeset: 2f4fbeb0ac27
Branch: yt
User: xarthisius
Date: 2016-09-07 18:19:19+00:00
Summary: Merged in ngoldbaum/yt (pull request #2359)
[BC] Make source_num of scene.get_source() have a default value of zero.
Affected #: 7 files
diff -r e4633c6dd06fdd0c416568bcfea3aac2e61b4e3d -r 2f4fbeb0ac2776ba881aa243e8ce27a75fa2fec1 doc/source/cookbook/amrkdtree_downsampling.py
--- a/doc/source/cookbook/amrkdtree_downsampling.py
+++ b/doc/source/cookbook/amrkdtree_downsampling.py
@@ -21,7 +21,7 @@
ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
im, sc = yt.volume_render(ds, 'density', fname='v0.png')
sc.camera.set_width(ds.arr(100, 'kpc'))
-render_source = sc.get_source(0)
+render_source = sc.get_source()
kd=render_source.volume
# Print out specifics of KD Tree
diff -r e4633c6dd06fdd0c416568bcfea3aac2e61b4e3d -r 2f4fbeb0ac2776ba881aa243e8ce27a75fa2fec1 doc/source/cookbook/custom_transfer_function_volume_rendering.py
--- a/doc/source/cookbook/custom_transfer_function_volume_rendering.py
+++ b/doc/source/cookbook/custom_transfer_function_volume_rendering.py
@@ -10,7 +10,7 @@
# Modify the transfer function
# First get the render source, in this case the entire domain, with field ('gas','density')
-render_source = sc.get_source(0)
+render_source = sc.get_source()
# Clear the transfer function
render_source.transfer_function.clear()
diff -r e4633c6dd06fdd0c416568bcfea3aac2e61b4e3d -r 2f4fbeb0ac2776ba881aa243e8ce27a75fa2fec1 doc/source/cookbook/opaque_rendering.py
--- a/doc/source/cookbook/opaque_rendering.py
+++ b/doc/source/cookbook/opaque_rendering.py
@@ -8,7 +8,7 @@
im, sc = yt.volume_render(ds, field=("gas","density"), fname="v0.png", sigma_clip=6.0)
sc.camera.set_width(ds.arr(0.1,'code_length'))
-tf = sc.get_source(0).transfer_function
+tf = sc.get_source().transfer_function
tf.clear()
tf.add_layers(4, 0.01, col_bounds = [-27.5,-25.5],
alpha=np.logspace(-3,0,4), colormap = 'RdBu_r')
@@ -19,7 +19,7 @@
# accentuate the outer regions of the galaxy. Let's start by bringing up the
# alpha values for each contour to go between 0.1 and 1.0
-tf = sc.get_source(0).transfer_function
+tf = sc.get_source().transfer_function
tf.clear()
tf.add_layers(4, 0.01, col_bounds = [-27.5,-25.5],
alpha=np.logspace(0,0,4), colormap = 'RdBu_r')
diff -r e4633c6dd06fdd0c416568bcfea3aac2e61b4e3d -r 2f4fbeb0ac2776ba881aa243e8ce27a75fa2fec1 doc/source/visualizing/TransferFunctionHelper_Tutorial.ipynb
--- a/doc/source/visualizing/TransferFunctionHelper_Tutorial.ipynb
+++ b/doc/source/visualizing/TransferFunctionHelper_Tutorial.ipynb
@@ -155,7 +155,7 @@
"source": [
"im, sc = yt.volume_render(ds, ['temperature'])\n",
"\n",
- "source = sc.get_source(0)\n",
+ "source = sc.get_source()\n",
"source.set_transfer_function(tfh.tf)\n",
"im2 = sc.render()\n",
"\n",
diff -r e4633c6dd06fdd0c416568bcfea3aac2e61b4e3d -r 2f4fbeb0ac2776ba881aa243e8ce27a75fa2fec1 doc/source/visualizing/Volume_Rendering_Tutorial.ipynb
--- a/doc/source/visualizing/Volume_Rendering_Tutorial.ipynb
+++ b/doc/source/visualizing/Volume_Rendering_Tutorial.ipynb
@@ -57,7 +57,7 @@
},
"outputs": [],
"source": [
- "print (sc.get_source(0))"
+ "print (sc.get_source())"
]
},
{
@@ -177,7 +177,7 @@
"tfh.tf.add_layers(10, colormap='gist_rainbow')\n",
"\n",
"# Grab the first render source and set it to use the new transfer function\n",
- "render_source = sc.get_source(0)\n",
+ "render_source = sc.get_source()\n",
"render_source.transfer_function = tfh.tf\n",
"\n",
"sc.render()\n",
diff -r e4633c6dd06fdd0c416568bcfea3aac2e61b4e3d -r 2f4fbeb0ac2776ba881aa243e8ce27a75fa2fec1 doc/source/visualizing/unstructured_mesh_rendering.rst
--- a/doc/source/visualizing/unstructured_mesh_rendering.rst
+++ b/doc/source/visualizing/unstructured_mesh_rendering.rst
@@ -105,7 +105,7 @@
sc = yt.create_scene(ds)
# override the default colormap
- ms = sc.get_source(0)
+ ms = sc.get_source()
ms.cmap = 'Eos A'
# adjust the camera position and orientation
@@ -133,7 +133,7 @@
sc = yt.create_scene(ds)
# override the default colormap
- ms = sc.get_source(0)
+ ms = sc.get_source()
ms.cmap = 'Eos A'
# adjust the camera position and orientation
@@ -165,7 +165,7 @@
sc = yt.create_scene(ds, ('connect2', 'diffused'))
# override the default colormap
- ms = sc.get_source(0)
+ ms = sc.get_source()
ms.cmap = 'Eos A'
# adjust the camera position and orientation
@@ -196,7 +196,7 @@
sc = yt.create_scene(ds, ("connect1", "u"))
# override the default colormap
- ms = sc.get_source(0)
+ ms = sc.get_source()
ms.cmap = 'Eos A'
# adjust the camera position and orientation
@@ -224,7 +224,7 @@
sc = yt.create_scene(ds, ('connect2', 'diffused'))
# override the default colormap
- ms = sc.get_source(0)
+ ms = sc.get_source()
ms.cmap = 'Eos A'
# adjust the camera position and orientation
@@ -250,7 +250,7 @@
# override the default colormap. This time we also override
# the default color bounds
- ms = sc.get_source(0)
+ ms = sc.get_source()
ms.cmap = 'hot'
ms.color_bounds = (500.0, 1700.0)
@@ -287,7 +287,7 @@
# override the default colormap. This time we also override
# the default color bounds
- ms = sc.get_source(0)
+ ms = sc.get_source()
ms.cmap = 'hot'
ms.color_bounds = (500.0, 1700.0)
@@ -320,7 +320,7 @@
sc = yt.create_scene(ds, ("connect2", "diffused"))
# override the default colormap
- ms = sc.get_source(0)
+ ms = sc.get_source()
ms.cmap = 'Eos A'
# Create a perspective Camera
@@ -392,7 +392,7 @@
sc = yt.create_scene(ds)
# override the default colormap
- ms = sc.get_source(0)
+ ms = sc.get_source()
ms.cmap = 'Eos A'
# adjust the camera position and orientation
diff -r e4633c6dd06fdd0c416568bcfea3aac2e61b4e3d -r 2f4fbeb0ac2776ba881aa243e8ce27a75fa2fec1 yt/visualization/volume_rendering/scene.py
--- a/yt/visualization/volume_rendering/scene.py
+++ b/yt/visualization/volume_rendering/scene.py
@@ -98,7 +98,7 @@
# pass kwargs into _repr_png_()
self._sigma_clip = None
- def get_source(self, source_num):
+ def get_source(self, source_num=0):
"""Returns the volume rendering source indexed by ``source_num``"""
return list(itervalues(self.sources))[source_num]
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