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

Bitbucket commits-noreply at bitbucket.org
Wed Jul 11 22:03:29 PDT 2012


2 new commits in yt:


https://bitbucket.org/yt_analysis/yt/changeset/c33aa850a532/
changeset:   c33aa850a532
branch:      yt
user:        MatthewTurk
date:        2012-07-12 07:03:03
summary:     Deleting processor pool, enabling muliple readers for Rockstar.
affected #:  2 files

diff -r 94b06429c80a903f95cf2abe0f54877d251ed13c -r c33aa850a532de845bc3ada9c931b6c2ac997699 yt/analysis_modules/halo_finding/rockstar/rockstar.py
--- a/yt/analysis_modules/halo_finding/rockstar/rockstar.py
+++ b/yt/analysis_modules/halo_finding/rockstar/rockstar.py
@@ -68,23 +68,15 @@
         self.re = right_edge
         if self.num_readers + self.num_writers + 1 != self.comm.size:
             print '%i reader + %i writers != %i mpi'%\
-                    (self.num_reader,self.num_writers,self.comm.size)
+                    (self.num_readers, self.num_writers, self.comm.size)
             raise RuntimeError
         self.center = (pf.domain_right_edge + pf.domain_left_edge)/2.0
-        data_source = None
-        if self.comm.size > 1:
-            self.pool = ProcessorPool()
-            self.pool.add_workgroup(1, name = "server")
-            self.pool.add_workgroup(num_readers, name = "readers")
-            self.pool.add_workgroup(num_writers, name = "writers")
-            for wg in self.pool.workgroups:
-                if self.comm.rank in wg.ranks: self.workgroup = wg
         data_source = self.pf.h.all_data()
+        self.handler = rockstar_interface.RockstarInterface(
+                self.pf, data_source)
         if outbase is None:
             outbase = str(self.pf)+'_rockstar'
         self.outbase = outbase        
-        self.handler = rockstar_interface.RockstarInterface(
-                self.pf, data_source)
 
     def _get_hosts(self):
         if self.comm.size == 1 or self.workgroup.name == "server":
@@ -103,6 +95,15 @@
         """
         
         """
+        if self.comm.size > 1:
+            self.pool = ProcessorPool()
+            mylog.debug("Num Writers = %s Num Readers = %s",
+                        self.num_writers, self.num_readers)
+            self.pool.add_workgroup(1, name = "server")
+            self.pool.add_workgroup(self.num_readers, name = "readers")
+            self.pool.add_workgroup(self.num_writers, name = "writers")
+            for wg in self.pool.workgroups:
+                if self.comm.rank in wg.ranks: self.workgroup = wg
         if block_ratio != 1:
             raise NotImplementedError
         self._get_hosts()
@@ -134,6 +135,7 @@
             elif self.workgroup.name == "writers":
                 time.sleep(0.2 + self.workgroup.comm.rank/10.0)
                 self.handler.start_client()
+            self.pool.free_all()
         self.comm.barrier()
         #quickly rename the out_0.list 
     


diff -r 94b06429c80a903f95cf2abe0f54877d251ed13c -r c33aa850a532de845bc3ada9c931b6c2ac997699 yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
--- a/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
+++ b/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
@@ -321,6 +321,7 @@
         NUM_READERS = num_readers
         NUM_SNAPS = 1
         NUM_WRITERS = num_writers
+        NUM_BLOCKS = num_readers
         MIN_HALO_OUTPUT_SIZE=min_halo_size
         self.block_ratio = block_ratio
 



https://bitbucket.org/yt_analysis/yt/changeset/2df4bc2c8e64/
changeset:   2df4bc2c8e64
branch:      yt
user:        MatthewTurk
date:        2012-07-12 07:03:19
summary:     Merging
affected #:  3 files

diff -r c33aa850a532de845bc3ada9c931b6c2ac997699 -r 2df4bc2c8e640b0b31c94a8573e66dd8908af784 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -166,6 +166,7 @@
             if vv < max_nu and vv > 1.0:
                 good_u = unit
                 max_nu = v*self[unit]
+        if good_u is None : good_u = 'cm'
         return good_u
 
     def has_key(self, key):


diff -r c33aa850a532de845bc3ada9c931b6c2ac997699 -r 2df4bc2c8e640b0b31c94a8573e66dd8908af784 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -61,6 +61,8 @@
     _type_name = "velocity"
     def __init__(self, factor=16, scale=None, scale_units=None, normalize=False):
         """
+        annotate_velocity(factor=16, scale=None, scale_units=None, normalize=False):
+        
         Adds a 'quiver' plot of velocity to the plot, skipping all but
         every *factor* datapoint. *scale* is the data units per arrow
         length unit using *scale_units* (see
@@ -93,6 +95,8 @@
     _type_name = "magnetic_field"
     def __init__(self, factor=16, scale=None, scale_units=None, normalize=False):
         """
+        annotate_magnetic_field(factor=16, scale=None, scale_units=None, normalize=False):
+
         Adds a 'quiver' plot of magnetic field to the plot, skipping all but
         every *factor* datapoint. *scale* is the data units per arrow
         length unit using *scale_units* (see
@@ -121,6 +125,8 @@
     _type_name = "quiver"
     def __init__(self, field_x, field_y, factor, scale=None, scale_units=None, normalize=False):
         """
+        annotate_quiver(field_x, field_y, factor, scale=None, scale_units=None, normalize=False):
+
         Adds a 'quiver' plot to any plot, using the *field_x* and *field_y*
         from the associated data, skipping every *factor* datapoints
         *scale* is the data units per arrow length unit using *scale_units* 
@@ -173,6 +179,9 @@
     def __init__(self, field, ncont=5, factor=4, take_log=False, clim=None,
                  plot_args = None):
         """
+        annotate_contour(self, field, ncont=5, factor=4, take_log=False, clim=None,
+                         plot_args = None):
+
         Add contours in *field* to the plot.  *ncont* governs the number of
         contours generated, *factor* governs the number of points used in the
         interpolation, *take_log* governs how it is contoured and *clim* gives
@@ -239,6 +248,8 @@
     _type_name = "grids"
     def __init__(self, alpha=1.0, min_pix=1, annotate=False, periodic=True):
         """
+        annotate_grids(alpha=1.0, min_pix=1, annotate=False, periodic=True)
+
         Adds grid boundaries to a plot, optionally with *alpha*-blending.
         Cuttoff for display is at *min_pix* wide.
         *annotate* puts the grid id in the corner of the grid.  (Not so great in projections...)
@@ -303,6 +314,11 @@
                  start_at_xedge=False, start_at_yedge=False,
                  plot_args=None):
         """
+        annotate_streamlines(field_x, field_y, factor=6.0, nx=16, ny=16,
+                             xstart=(0,1), ystart=(0,1), nsample=256,
+                             start_at_xedge=False, start_at_yedge=False,
+                             plot_args=None):
+
         Add streamlines to any plot, using the *field_x* and *field_y*
         from the associated data, using *nx* and *ny* starting points
         that are bounded by *xstart* and *ystart*.  To begin
@@ -395,6 +411,7 @@
         if vv < max_nu and vv > 1.0:
             good_u = unit
             max_nu = v*pf[unit]
+    if good_u is None : good_u = 'cm'
     return good_u
 
 class UnitBoundaryCallback(PlotCallback):
@@ -461,6 +478,8 @@
     _type_name = "line"
     def __init__(self, x, y, plot_args = None):
         """
+        annotate_line(x, y, plot_args = None)
+
         Over plot *x* and *y* with *plot_args* fed into the plot.
         """
         PlotCallback.__init__(self)
@@ -479,6 +498,8 @@
 
     def __init__(self, p1, p2, data_coords=False, plot_args = None):
         """
+        annotate_image_line(p1, p2, data_coords=False, plot_args = None)
+
         Plot from *p1* to *p2* (image plane coordinates)
         with *plot_args* fed into the plot.
         """
@@ -519,6 +540,8 @@
     _type_name = "cquiver"
     def __init__(self, field_x, field_y, factor):
         """
+        annotate_cquiver(field_x, field_y, factor)
+
         Get a quiver plot on top of a cutting plane, using *field_x* and
         *field_y*, skipping every *factor* datapoint in the discretization.
         """
@@ -561,6 +584,8 @@
     _type_name = "clumps"
     def __init__(self, clumps, plot_args = None):
         """
+        annotate_clumps(clumps, plot_args = None)
+
         Take a list of *clumps* and plot them as a set of contours.
         """
         self.clumps = clumps
@@ -608,6 +633,8 @@
     _type_name = "arrow"
     def __init__(self, pos, code_size, plot_args = None):
         """
+        annotate_arrow(pos, code_size, plot_args = None)
+
         This adds an arrow pointing at *pos* with size *code_size* in code
         units.  *plot_args* is a dict fed to matplotlib with arrow properties.
         """
@@ -630,6 +657,8 @@
     _type_name = "point"
     def __init__(self, pos, text, text_args = None):
         """
+        annotate_point(pos, text, text_args = None)
+
         This adds *text* at position *pos*, where *pos* is in code-space.
         *text_args* is a dict fed to the text placement code.
         """
@@ -651,6 +680,8 @@
     _type_name = "marker"
     def __init__(self, pos, marker='x', plot_args=None):
         """
+        annotate_marker(pos, marker='x', plot_args=None)
+
         Adds text *marker* at *pos* in code-arguments.  *plot_args* is a dict
         that will be forwarded to the plot command.
         """
@@ -674,6 +705,9 @@
     def __init__(self, center, radius, circle_args = None,
                  text = None, text_args = None):
         """
+        annotate_sphere(center, radius, circle_args = None,
+                        text = None, text_args = None)
+        
         A sphere centered at *center* in code units with radius *radius* in
         code units will be created, with optional *circle_args*, *text*, and
         *text_args*.
@@ -713,6 +747,11 @@
                  font_size=8, print_halo_size=False,
                  print_halo_mass=False, width=None):
         """
+        annotate_hop_circles(hop_output, max_number=None,
+                             annotate=False, min_size=20, max_size=10000000,
+                             font_size=8, print_halo_size=False,
+                             print_halo_mass=False, width=None)
+
         Accepts a :class:`yt.HopList` *hop_output* and plots up to
         *max_number* (None for unlimited) halos as circles.
         """
@@ -766,6 +805,9 @@
     def __init__(self, hop_output, max_number, p_size=1.0,
                 min_size=20, alpha=0.2):
         """
+        annotate_hop_particles(hop_output, max_number, p_size=1.0,
+                               min_size=20, alpha=0.2):
+
         Adds particle positions for the members of each halo as identified
         by HOP. Along *axis* up to *max_number* groups in *hop_output* that are
         larger than *min_size* are plotted with *p_size* pixels per particle; 
@@ -911,6 +953,8 @@
     _type_name = "text"
     def __init__(self, pos, text, data_coords=False, text_args = None):
         """
+        annotate_text(pos, text, data_coords=False, text_args = None)
+
         Accepts a position in (0..1, 0..1) of the image, some text and
         optionally some text arguments. If data_coords is True,
         position will be in code units instead of image coordinates.
@@ -943,6 +987,10 @@
                  ptype=None, stars_only=False, dm_only=False,
                  minimum_mass=None, alpha=1.0):
         """
+        annotate_particles(width, p_size=1.0, col='k', marker='o', stride=1.0,
+                           ptype=None, stars_only=False, dm_only=False,
+                           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
         pixels per particle, and *col* governs the color.  *ptype* will
@@ -1017,8 +1065,10 @@
 
 class TitleCallback(PlotCallback):
     _type_name = "title"
-    def __init__(self, title="Plot"):
+    def __init__(self, title):
         """
+        annotate_title(title)
+
         Accepts a *title* and adds it to the plot
         """
         PlotCallback.__init__(self)


diff -r c33aa850a532de845bc3ada9c931b6c2ac997699 -r 2df4bc2c8e640b0b31c94a8573e66dd8908af784 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -575,6 +575,7 @@
             cbname = callback_registry[key]._type_name
             CallbackMaker = getattr(CallbackMod,key)
             callback = invalidate_plot(apply_callback(getattr(CallbackMod,key)))
+            callback.__doc__ = CallbackMaker.__init__.__doc__
             self.__dict__['annotate_'+cbname] = types.MethodType(callback,self)
         
     def get_metadata(self, field, strip_mathml = True, return_string = True):

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