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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Feb 23 07:40:30 PST 2017


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/c528a59e016e/
Changeset:   c528a59e016e
Branch:      yt
User:        qobilidop
Date:        2017-02-23 01:04:22+00:00
Summary:     `stride` should be interger since it's used as index
Affected #:  2 files

diff -r 60c93dbd7e84ff58f702b6978f91ee0a07ead14a -r c528a59e016e28c036fdde9b6f4fbe2a45fc6a26 doc/source/visualizing/callbacks.rst
--- a/doc/source/visualizing/callbacks.rst
+++ b/doc/source/visualizing/callbacks.rst
@@ -433,7 +433,7 @@
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 .. function:: annotate_particles(self, width, p_size=1.0, col='k', marker='o',\
-                                 stride=1.0, ptype=None, minimum_mass=None, \
+                                 stride=1, ptype=None, minimum_mass=None, \
                                  alpha=1.0)
 
    (This is a proxy for

diff -r 60c93dbd7e84ff58f702b6978f91ee0a07ead14a -r c528a59e016e28c036fdde9b6f4fbe2a45fc6a26 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -1527,7 +1527,7 @@
 
 class ParticleCallback(PlotCallback):
     """
-    annotate_particles(width, p_size=1.0, col='k', marker='o', stride=1.0,
+    annotate_particles(width, p_size=1.0, col='k', marker='o', stride=1,
                        ptype=None, minimum_mass=None, alpha=1.0)
 
     Adds particle positions, based on a thick slab along *axis* with a
@@ -1542,7 +1542,7 @@
     region = None
     _descriptor = None
     _supported_geometries = ("cartesian", "spectral_cube")
-    def __init__(self, width, p_size=1.0, col='k', marker='o', stride=1.0,
+    def __init__(self, width, p_size=1.0, col='k', marker='o', stride=1,
                  ptype='all', minimum_mass=None, alpha=1.0):
         PlotCallback.__init__(self)
         self.width = width


https://bitbucket.org/yt_analysis/yt/commits/64f6660ba231/
Changeset:   64f6660ba231
Branch:      yt
User:        qobilidop
Date:        2017-02-23 01:15:51+00:00
Summary:     Sync doc with code
Affected #:  2 files

diff -r c528a59e016e28c036fdde9b6f4fbe2a45fc6a26 -r 64f6660ba23133ecae818b82160cc3cd1debb8e2 doc/source/visualizing/callbacks.rst
--- a/doc/source/visualizing/callbacks.rst
+++ b/doc/source/visualizing/callbacks.rst
@@ -433,7 +433,7 @@
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 .. function:: annotate_particles(self, width, p_size=1.0, col='k', marker='o',\
-                                 stride=1, ptype=None, minimum_mass=None, \
+                                 stride=1, ptype='all', minimum_mass=None, \
                                  alpha=1.0)
 
    (This is a proxy for

diff -r c528a59e016e28c036fdde9b6f4fbe2a45fc6a26 -r 64f6660ba23133ecae818b82160cc3cd1debb8e2 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -1528,7 +1528,7 @@
 class ParticleCallback(PlotCallback):
     """
     annotate_particles(width, p_size=1.0, col='k', marker='o', stride=1,
-                       ptype=None, minimum_mass=None, alpha=1.0)
+                       ptype='all', minimum_mass=None, alpha=1.0)
 
     Adds particle positions, based on a thick slab along *axis* with a
     *width* along the line of sight.  *p_size* controls the number of


https://bitbucket.org/yt_analysis/yt/commits/a6bbefb89e45/
Changeset:   a6bbefb89e45
Branch:      yt
User:        qobilidop
Date:        2017-02-23 02:48:30+00:00
Summary:     Test particles callback
Affected #:  1 file

diff -r 64f6660ba23133ecae818b82160cc3cd1debb8e2 -r a6bbefb89e456bd5378d5901d7a00d11fd6b0cbf yt/visualization/tests/test_callbacks.py
--- a/yt/visualization/tests/test_callbacks.py
+++ b/yt/visualization/tests/test_callbacks.py
@@ -56,7 +56,7 @@
 #    hop_particles
 #    coord_axes
 #  X text
-#    particles
+#  X particles
 #    title
 #    flash_ray_data
 #  X timestamp
@@ -255,6 +255,29 @@
         p.annotate_marker([0.5,0.5], coord_system="axis")
         yield assert_fname, p.save(prefix)[0]
 
+def test_particles_callback():
+    with _cleanup_fname() as prefix:
+        ax = 'z'
+        ds = fake_amr_ds(fields=("density",), particles=True)
+        p = ProjectionPlot(ds, ax, "density")
+        p.annotate_particles((10, "Mpc"))
+        yield assert_fname, p.save(prefix)[0]
+        p = SlicePlot(ds, ax, "density")
+        p.annotate_particles((10, "Mpc"))
+        yield assert_fname, p.save(prefix)[0]
+        # Now we'll check a few additional minor things
+        p = SlicePlot(ds, "x", "density")
+        p.annotate_particles((10, "Mpc"), p_size=1.0, col="k", marker="o",
+                             stride=1, ptype='all', minimum_mass=None,
+                             alpha=1.0)
+        p.save(prefix)
+
+    with _cleanup_fname() as prefix:
+        ds = fake_amr_ds(fields=("density",), geometry="spherical")
+        p = ProjectionPlot(ds, "r", "density")
+        p.annotate_particles((10, 'Mpc'))
+        yield assert_raises, YTDataTypeUnsupported, p.save, prefix
+
 def test_sphere_callback():
     with _cleanup_fname() as prefix:
         ax = 'z'


https://bitbucket.org/yt_analysis/yt/commits/ba64011e4b06/
Changeset:   ba64011e4b06
Branch:      yt
User:        qobilidop
Date:        2017-02-23 02:55:44+00:00
Summary:     Quotation marks consistency
Affected #:  1 file

diff -r a6bbefb89e456bd5378d5901d7a00d11fd6b0cbf -r ba64011e4b064b5d13a3a12e4fb64293ea5dfdab yt/visualization/tests/test_callbacks.py
--- a/yt/visualization/tests/test_callbacks.py
+++ b/yt/visualization/tests/test_callbacks.py
@@ -268,14 +268,14 @@
         # Now we'll check a few additional minor things
         p = SlicePlot(ds, "x", "density")
         p.annotate_particles((10, "Mpc"), p_size=1.0, col="k", marker="o",
-                             stride=1, ptype='all', minimum_mass=None,
+                             stride=1, ptype="all", minimum_mass=None,
                              alpha=1.0)
         p.save(prefix)
 
     with _cleanup_fname() as prefix:
         ds = fake_amr_ds(fields=("density",), geometry="spherical")
         p = ProjectionPlot(ds, "r", "density")
-        p.annotate_particles((10, 'Mpc'))
+        p.annotate_particles((10, "Mpc"))
         yield assert_raises, YTDataTypeUnsupported, p.save, prefix
 
 def test_sphere_callback():

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