<html><body>
<p>3 new commits in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/ea94b8f736c2/">https://bitbucket.org/yt_analysis/yt/commits/ea94b8f736c2/</a> Changeset: ea94b8f736c2 Branch: yt User: xarthisius Date: 2016-04-26 20:04:40+00:00 Summary: Create vector fields for magnetic_field. Closes #1213 Affected #: 4 files</p>
<p>diff -r 77db965d0a537a9884d6db3c5ad7595dc3070ba0 -r ea94b8f736c2f92adf3c625c677bd07418bb2cf6 yt/fields/field_aliases.py --- a/yt/fields/field_aliases.py +++ b/yt/fields/field_aliases.py @@ -79,8 +79,8 @@</p>
<pre>("TangentialVelocity", "tangential_velocity"),
("CuttingPlaneVelocityX", "cutting_plane_velocity_x"),
("CuttingPlaneVelocityY", "cutting_plane_velocity_y"),</pre>
<ul><li><p>("CuttingPlaneBX", "cutting_plane_bx"),</p></li>
<li><p>("CuttingPlaneBy", "cutting_plane_by"),</p></li></ul>
<p>+ ("CuttingPlaneBX", “cutting_plane_magnetic_field_x"), + ("CuttingPlaneBy”, "cutting_plane_magnetic_field_y"),</p>
<pre>("MeanMolecularWeight", "mean_molecular_weight"),
("particle_density", "particle_density"),
("ThermalEnergy", "thermal_energy"),</pre>
<p>diff -r 77db965d0a537a9884d6db3c5ad7595dc3070ba0 -r ea94b8f736c2f92adf3c625c677bd07418bb2cf6 yt/fields/fluid_fields.py --- a/yt/fields/fluid_fields.py +++ b/yt/fields/fluid_fields.py @@ -54,6 +54,7 @@</p>
<pre> unit_system = registry.ds.unit_system
create_vector_fields(registry, "velocity", unit_system["velocity"], ftype, slice_info)</pre>
<p>+ create_vector_fields(registry, “magnetic_field”, unit_system["magnetic_field"], ftype, slice_info)</p>
<pre>def _cell_mass(field, data):
return data[ftype, "density"] * data[ftype, "cell_volume"]</pre>
<p>diff -r 77db965d0a537a9884d6db3c5ad7595dc3070ba0 -r ea94b8f736c2f92adf3c625c677bd07418bb2cf6 yt/fields/vector_operations.py --- a/yt/fields/vector_operations.py +++ b/yt/fields/vector_operations.py @@ -183,13 +183,15 @@</p>
<pre> def _cp_vectors(ax):
def _cp_val(field, data):
vec = data.get_field_parameter("cp_%s_vec" % (ax))</pre>
<ul><li><p>bv = data.get_field_parameter("bulk_%s" % basename)</p></li>
<li><p>if bv is None: bv = np.zeros(3)</p></li>
<li><p>tr = (data[xn] – bv[0]) * vec[0]</p></li>
<li><p>tr += (data[yn] – bv[1]) * vec[1]</p></li>
<li><p>tr += (data[zn] – bv[2]) * vec[2]</p></li></ul>
<p>+ bv = data.get_field_parameter("bulk_%s" % basename, None) + if bv is None: + bv = data.ds.arr(np.zeros(3), data[xn].units) + tr = (data[xn] – bv[0]) * vec.d[0] + tr += (data[yn] – bv[1]) * vec.d[1] + tr += (data[zn] – bv[2]) * vec.d[2]</p>
<pre>return tr
return _cp_val</pre>
<p>+</p>
<pre> registry.add_field((ftype, "cutting_plane_%s_x" % basename),
function=_cp_vectors('x'),
units=field_units)</pre>
<p>diff -r 77db965d0a537a9884d6db3c5ad7595dc3070ba0 -r ea94b8f736c2f92adf3c625c677bd07418bb2cf6 yt/visualization/plot_modifications.py --- a/yt/visualization/plot_modifications.py +++ b/yt/visualization/plot_modifications.py @@ -309,8 +309,8 @@</p>
<pre>def __call__(self, plot):
# Instantiation of these is cheap
if plot._type_name == "CuttingPlane":</pre>
<ul><li><p>qcb = CuttingQuiverCallback("cutting_plane_bx",</p></li>
<li><p>“cutting_plane_by”,</p></li></ul>
<p>+ qcb = CuttingQuiverCallback("cutting_plane_magnetic_field_x", + “cutting_plane_magnetic_field_y”,</p>
<pre> self.factor)
else:
xax = plot.data.ds.coordinates.x_axis[plot.data.axis]</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/ac0037c4877b/">https://bitbucket.org/yt_analysis/yt/commits/ac0037c4877b/</a> Changeset: ac0037c4877b Branch: yt User: xarthisius Date: 2016-04-26 20:22:50+00:00 Summary: Add tests for vel/B fields annotation for off axis slices Affected #: 1 file</p>
<p>diff -r ea94b8f736c2f92adf3c625c677bd07418bb2cf6 -r ac0037c4877be1e617a625eb3c02a7e72c729200 yt/visualization/tests/test_callbacks.py --- a/yt/visualization/tests/test_callbacks.py +++ b/yt/visualization/tests/test_callbacks.py @@ -246,11 +246,15 @@</p>
<pre>p = SlicePlot(ds, ax, "density")
p.annotate_velocity()
yield assert_fname, p.save(prefix)[0]</pre>
<p>+ # Test for OffAxis Slice + p = SlicePlot(ds, [1, 1, 0], ‘density’, north_vector=[0, 0, 1]) + p.annotate_velocity(factor=40, normalize=True) + yield assert_fname, p.save(prefix)[0]</p>
<pre> # Now we'll check a few additional minor things
p = SlicePlot(ds, "x", "density")
p.annotate_velocity(factor=8, scale=0.5, scale_units="inches",
normalize = True)</pre>
<ul><li><p>p.save(prefix)</p></li></ul>
<p>+ yield assert_fname, p.save(prefix)[0]</p>
<pre>def test_magnetic_callback():
with _cleanup_fname() as prefix:</pre>
<p>@@ -263,11 +267,15 @@</p>
<pre>p = SlicePlot(ds, ax, "density")
p.annotate_magnetic_field()
yield assert_fname, p.save(prefix)[0]</pre>
<p>+ # Test for OffAxis Slice + p = SlicePlot(ds, [1, 1, 0], ‘density’, north_vector=[0, 0, 1]) + p.annotate_magnetic_field(factor=40, normalize=True) + yield assert_fname, p.save(prefix)[0]</p>
<pre> # Now we'll check a few additional minor things
p = SlicePlot(ds, "x", "density")
p.annotate_magnetic_field(factor=8, scale=0.5,
scale_units="inches", normalize = True)</pre>
<ul><li><p>p.save(prefix)</p></li></ul>
<p>+ yield assert_fname, p.save(prefix)[0]</p>
<pre>def test_quiver_callback():
with _cleanup_fname() as prefix:</pre>
<p>@@ -289,7 +297,7 @@</p>
<pre>scale_units="inches", normalize = True,
bv_x = 0.5 * u.cm / u.s,
bv_y = 0.5 * u.cm / u.s)</pre>
<ul><li><p>p.save(prefix)</p></li></ul>
<p>+ yield assert_fname, p.save(prefix)[0]</p>
<pre>def test_contour_callback():
with _cleanup_fname() as prefix:</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/e3f37d2893ac/">https://bitbucket.org/yt_analysis/yt/commits/e3f37d2893ac/</a> Changeset: e3f37d2893ac Branch: yt User: atmyers Date: 2016-04-29 17:18:37+00:00 Summary: Merged in xarthisius/yt (pull request #2146)</p>
<p>Create vector fields for magnetic_field. Closes #1213 Affected #: 5 files</p>
<p>diff -r 0daf747c5d006d087f132b62d750c61874a76e19 -r e3f37d2893ac2696f4836980cfc0679f5ed7c399 yt/fields/field_aliases.py --- a/yt/fields/field_aliases.py +++ b/yt/fields/field_aliases.py @@ -79,8 +79,8 @@</p>
<pre>("TangentialVelocity", "tangential_velocity"),
("CuttingPlaneVelocityX", "cutting_plane_velocity_x"),
("CuttingPlaneVelocityY", "cutting_plane_velocity_y"),</pre>
<ul><li><p>("CuttingPlaneBX", "cutting_plane_bx"),</p></li>
<li><p>("CuttingPlaneBy", "cutting_plane_by"),</p></li></ul>
<p>+ ("CuttingPlaneBX", “cutting_plane_magnetic_field_x"), + ("CuttingPlaneBy”, "cutting_plane_magnetic_field_y"),</p>
<pre>("MeanMolecularWeight", "mean_molecular_weight"),
("particle_density", "particle_density"),
("ThermalEnergy", "thermal_energy"),</pre>
<p>diff -r 0daf747c5d006d087f132b62d750c61874a76e19 -r e3f37d2893ac2696f4836980cfc0679f5ed7c399 yt/fields/fluid_fields.py --- a/yt/fields/fluid_fields.py +++ b/yt/fields/fluid_fields.py @@ -54,6 +54,7 @@</p>
<pre> unit_system = registry.ds.unit_system
create_vector_fields(registry, "velocity", unit_system["velocity"], ftype, slice_info)</pre>
<p>+ create_vector_fields(registry, “magnetic_field”, unit_system["magnetic_field"], ftype, slice_info)</p>
<pre>def _cell_mass(field, data):
return data[ftype, "density"] * data[ftype, "cell_volume"]</pre>
<p>diff -r 0daf747c5d006d087f132b62d750c61874a76e19 -r e3f37d2893ac2696f4836980cfc0679f5ed7c399 yt/fields/vector_operations.py --- a/yt/fields/vector_operations.py +++ b/yt/fields/vector_operations.py @@ -183,13 +183,15 @@</p>
<pre> def _cp_vectors(ax):
def _cp_val(field, data):
vec = data.get_field_parameter("cp_%s_vec" % (ax))</pre>
<ul><li><p>bv = data.get_field_parameter("bulk_%s" % basename)</p></li>
<li><p>if bv is None: bv = np.zeros(3)</p></li>
<li><p>tr = (data[xn] – bv[0]) * vec[0]</p></li>
<li><p>tr += (data[yn] – bv[1]) * vec[1]</p></li>
<li><p>tr += (data[zn] – bv[2]) * vec[2]</p></li></ul>
<p>+ bv = data.get_field_parameter("bulk_%s" % basename, None) + if bv is None: + bv = data.ds.arr(np.zeros(3), data[xn].units) + tr = (data[xn] – bv[0]) * vec.d[0] + tr += (data[yn] – bv[1]) * vec.d[1] + tr += (data[zn] – bv[2]) * vec.d[2]</p>
<pre>return tr
return _cp_val</pre>
<p>+</p>
<pre> registry.add_field((ftype, "cutting_plane_%s_x" % basename),
function=_cp_vectors('x'),
units=field_units)</pre>
<p>diff -r 0daf747c5d006d087f132b62d750c61874a76e19 -r e3f37d2893ac2696f4836980cfc0679f5ed7c399 yt/visualization/plot_modifications.py --- a/yt/visualization/plot_modifications.py +++ b/yt/visualization/plot_modifications.py @@ -309,8 +309,8 @@</p>
<pre>def __call__(self, plot):
# Instantiation of these is cheap
if plot._type_name == "CuttingPlane":</pre>
<ul><li><p>qcb = CuttingQuiverCallback("cutting_plane_bx",</p></li>
<li><p>“cutting_plane_by”,</p></li></ul>
<p>+ qcb = CuttingQuiverCallback("cutting_plane_magnetic_field_x", + “cutting_plane_magnetic_field_y”,</p>
<pre> self.factor)
else:
xax = plot.data.ds.coordinates.x_axis[plot.data.axis]</pre>
<p>diff -r 0daf747c5d006d087f132b62d750c61874a76e19 -r e3f37d2893ac2696f4836980cfc0679f5ed7c399 yt/visualization/tests/test_callbacks.py --- a/yt/visualization/tests/test_callbacks.py +++ b/yt/visualization/tests/test_callbacks.py @@ -246,11 +246,15 @@</p>
<pre>p = SlicePlot(ds, ax, "density")
p.annotate_velocity()
yield assert_fname, p.save(prefix)[0]</pre>
<p>+ # Test for OffAxis Slice + p = SlicePlot(ds, [1, 1, 0], ‘density’, north_vector=[0, 0, 1]) + p.annotate_velocity(factor=40, normalize=True) + yield assert_fname, p.save(prefix)[0]</p>
<pre> # Now we'll check a few additional minor things
p = SlicePlot(ds, "x", "density")
p.annotate_velocity(factor=8, scale=0.5, scale_units="inches",
normalize = True)</pre>
<ul><li><p>p.save(prefix)</p></li></ul>
<p>+ yield assert_fname, p.save(prefix)[0]</p>
<pre>def test_magnetic_callback():
with _cleanup_fname() as prefix:</pre>
<p>@@ -263,11 +267,15 @@</p>
<pre>p = SlicePlot(ds, ax, "density")
p.annotate_magnetic_field()
yield assert_fname, p.save(prefix)[0]</pre>
<p>+ # Test for OffAxis Slice + p = SlicePlot(ds, [1, 1, 0], ‘density’, north_vector=[0, 0, 1]) + p.annotate_magnetic_field(factor=40, normalize=True) + yield assert_fname, p.save(prefix)[0]</p>
<pre> # Now we'll check a few additional minor things
p = SlicePlot(ds, "x", "density")
p.annotate_magnetic_field(factor=8, scale=0.5,
scale_units="inches", normalize = True)</pre>
<ul><li><p>p.save(prefix)</p></li></ul>
<p>+ yield assert_fname, p.save(prefix)[0]</p>
<pre>def test_quiver_callback():
with _cleanup_fname() as prefix:</pre>
<p>@@ -289,7 +297,7 @@</p>
<pre>scale_units="inches", normalize = True,
bv_x = 0.5 * u.cm / u.s,
bv_y = 0.5 * u.cm / u.s)</pre>
<ul><li><p>p.save(prefix)</p></li></ul>
<p>+ yield assert_fname, p.save(prefix)[0]</p>
<pre>def test_contour_callback():
with _cleanup_fname() as prefix:</pre>
<p>Repository URL: <a href="https://bitbucket.org/yt_analysis/yt/">https://bitbucket.org/yt_analysis/yt/</a></p>
<p>—</p>
<p>This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.</p>
<img src="http://link.bitbucket.org/wf/open?upn=ll4ctv0L-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27CSdxn6ONgh8uOzxam04g3Sqjd4GzzW-2BonRaJuiwYmR2hxsVbeXJ-2F25yvJv-2BmmzthHAhlw37tIuqhDVU6ieME935gA1DtLdRh1L9vPG8mDUsPx5vHMLxEg4QP-2FQygzh5dfURbfCh23bMeeQcov-2BPih4P9Pzk2JbEeasHVuhks74zUyeHRBWwPs41SRMoXjgjFw-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body></html>