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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sun May 4 13:14:47 PDT 2014


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/7e0be3e79bac/
Changeset:   7e0be3e79bac
Branch:      yt-3.0
User:        smumford
Date:        2014-05-03 23:06:13
Summary:     First pass at making _frb frb
Affected #:  1 file

diff -r c05e890f48672898e8afd3f6a4c9d81a8a28b892 -r 7e0be3e79bacb7cb88b241bb6c50e88f3da70268 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -264,7 +264,7 @@
         including the margins but not the colorbar.
 
     """
-    _frb = None
+    frb = None
     def __init__(self, data_source, bounds, buff_size=(800,800), antialias=True,
                  periodic=True, origin='center-window', oblique=False,
                  window_size=8.0, fields=None, fontsize=18, setup=False):
@@ -294,7 +294,7 @@
                       range(len(self.data_source.center))
                       if i != self.data_source.axis]
             self.set_center(center)
-        for field in self._frb.data.keys():
+        for field in self.frb.data.keys():
             finfo = self.data_source.pf._get_field_info(*field)
             if finfo.take_log:
                 self._field_transform[field] = log_transform
@@ -322,27 +322,27 @@
 
     def _recreate_frb(self):
         old_fields = None
-        if self._frb is not None:
-            old_fields = self._frb.keys()
-            old_units = [str(self._frb[of].units) for of in old_fields]
+        if self.frb is not None:
+            old_fields = self.frb.keys()
+            old_units = [str(self.frb[of].units) for of in old_fields]
         if hasattr(self,'zlim'):
             bounds = self.xlim+self.ylim+self.zlim
         else:
             bounds = self.xlim+self.ylim
         if self._frb_generator is ObliqueFixedResolutionBuffer:
             bounds = np.array(bounds)
-        self._frb = self._frb_generator(self.data_source,
+        self.frb = self._frb_generator(self.data_source,
                                         bounds, self.buff_size,
                                         self.antialias,
                                         periodic=self._periodic)
         if old_fields is None:
-            self._frb._get_data_source_fields()
+            self.frb._get_data_source_fields()
         else:
             for key, unit in zip(old_fields, old_units):
-                self._frb[key]
-                self._frb[key].convert_to_units(unit)
+                self.frb[key]
+                self.frb[key].convert_to_units(unit)
         for key in self.override_fields:
-            self._frb[key]
+            self.frb[key]
         self._data_valid = True
 
     @property
@@ -442,7 +442,7 @@
                 "Field list {} and unit "
                 "list {} are incompatible".format(field, new_unit))
         for f, u in zip(field, new_unit):
-            self._frb[f].convert_to_units(u)
+            self.frb[f].convert_to_units(u)
         return self
 
     @invalidate_data
@@ -513,7 +513,7 @@
 
         axes_unit = get_axes_unit(width, self.pf)
 
-        width = get_sanitized_width(self._frb.axis, width, None, self.pf)
+        width = get_sanitized_width(self.frb.axis, width, None, self.pf)
 
         centerx = (self.xlim[1] + self.xlim[0])/2.
         centery = (self.ylim[1] + self.ylim[0])/2.
@@ -744,7 +744,7 @@
             else:
                 zlim = (None, None)
 
-            image = self._frb[f]
+            image = self.frb[f]
 
             if image.max() == image.min():
               if self._field_transform[f] == log_transform:
@@ -828,7 +828,7 @@
             colorbar_label = image.info['label']
 
             # Determine the units of the data
-            units = Unit(self._frb[f].units, registry=self.pf.unit_registry)
+            units = Unit(self.frb[f].units, registry=self.pf.unit_registry)
             units = units.latex_representation()
 
             if units is None or units == '':
@@ -1373,14 +1373,14 @@
             addl_keys = {'type': 'widget_payload',
                          'widget_id': self._ext_widget_id}
         else:
-            fields = self._frb.data.keys()
+            fields = self.frb.data.keys()
             addl_keys = {}
         if self._colorbar_valid == False:
             addl_keys['colorbar_image'] = self._get_cbar_image()
             self._colorbar_valid = True
         min_zoom = 200*self.pf.index.get_smallest_dx() * self.pf['unitary']
         for field in fields:
-            to_plot = apply_colormap(self._frb[field],
+            to_plot = apply_colormap(self.frb[field],
                 func = self._field_transform[field],
                 cmap_name = self._colormaps[field])
             pngs = self._apply_modifications(to_plot)
@@ -1429,8 +1429,8 @@
         field, number, colors, logit = self._contour_info
         if colors is not None: plot_args['colors'] = colors
 
-        raw_data = self._frb.data_source
-        b = self._frb.bounds
+        raw_data = self.frb.data_source
+        b = self.frb.bounds
         xi, yi = np.mgrid[b[0]:b[1]:(vi / 8) * 1j,
                           b[2]:b[3]:(vj / 8) * 1j]
         x = raw_data['px']
@@ -1445,15 +1445,15 @@
         if self._vector_info is None: return
         skip, scale = self._vector_info
 
-        nx = self._frb.buff_size[0]/skip
-        ny = self._frb.buff_size[1]/skip
-        new_frb = FixedResolutionBuffer(self._frb.data_source,
-                        self._frb.bounds, (nx,ny))
+        nx = self.frb.buff_size[0]/skip
+        ny = self.frb.buff_size[1]/skip
+        new_frb = FixedResolutionBuffer(self.frb.data_source,
+                        self.frb.bounds, (nx,ny))
 
-        axis = self._frb.data_source.axis
-        xax = self._frb.data_source.pf.coordinates.x_axis[axis]
-        yax = self._frb.data_source.pf.coordinates.y_axis[axis]
-        axis_names = self._frb.data_source.pf.coordinates.axis_name
+        axis = self.frb.data_source.axis
+        xax = self.frb.data_source.pf.coordinates.x_axis[axis]
+        yax = self.frb.data_source.pf.coordinates.y_axis[axis]
+        axis_names = self.frb.data_source.pf.coordinates.axis_name
         fx = "velocity_%s" % (axis_names[xax])
         fy = "velocity_%x" % (axis_names[yax])
         px = new_frb[fx][::-1,:]
@@ -1471,7 +1471,7 @@
         # This will eventually change to work with non-logged fields
         ticks = []
         transform = self._field_transform[field]
-        mi, ma = self._frb[field].min(), self._frb[field].max()
+        mi, ma = self.frb[field].min(), self.frb[field].max()
         tick_locs = transform.ticks(mi, ma)
         mi, ma = transform((mi, ma))
         for v1,v2 in zip(tick_locs, transform(tick_locs)):
@@ -1509,7 +1509,7 @@
         self.set_center((new_x, new_y))
 
     def get_field_units(self, field, strip_mathml = True):
-        ds = self._frb.data_source
+        ds = self.frb.data_source
         pf = self.pf
         field = self._check_field(field)
         finfo = self.data_source.pf._get_field_info(*field)
@@ -1527,7 +1527,7 @@
         return units
 
     def get_metadata(self, field, strip_mathml = True, return_string = True):
-        fval = self._frb[field]
+        fval = self.frb[field]
         mi = fval.min()
         ma = fval.max()
         x_width = self.xlim[1] - self.xlim[0]
@@ -1538,10 +1538,10 @@
         else:
             unit = self._axes_unit_names
         units = self.get_field_units(field, strip_mathml)
-        center = getattr(self._frb.data_source, "center", None)
-        xax = self.pf.coordinates.x_axis[self._frb.axis]
-        yax = self.pf.coordinates.y_axis[self._frb.axis]
-        if center is None or self._frb.axis == 4:
+        center = getattr(self.frb.data_source, "center", None)
+        xax = self.pf.coordinates.x_axis[self.frb.axis]
+        yax = self.pf.coordinates.y_axis[self.frb.axis]
+        if center is None or self.frb.axis == 4:
             xc, yc, zc = -999, -999, -999
         else:
             center[xax] = 0.5 * (
@@ -1580,7 +1580,7 @@
     def set_current_field(self, field):
         field = self._check_field(field)
         self._current_field = field
-        self._frb[field]
+        self.frb[field]
         finfo = self.data_source.pf._get_field_info(*field)
         if finfo.take_log:
             self._field_transform[field] = log_transform


https://bitbucket.org/yt_analysis/yt/commits/412bff8be08a/
Changeset:   412bff8be08a
Branch:      yt-3.0
User:        smumford
Date:        2014-05-03 23:14:30
Summary:     More frb fixes
Affected #:  1 file

diff -r 7e0be3e79bacb7cb88b241bb6c50e88f3da70268 -r 412bff8be08a142c9c59b57fc8a2a431d54bef26 yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -270,15 +270,15 @@
         return self.plots[item]
 
     def run_callbacks(self, f):
-        keys = self._frb.keys()
+        keys = self.frb.keys()
         for name, (args, kwargs) in self._callbacks:
-            cbw = CallbackWrapper(self, self.plots[f], self._frb, f)
+            cbw = CallbackWrapper(self, self.plots[f], self.frb, f)
             CallbackMaker = callback_registry[name]
             callback = CallbackMaker(*args[1:], **kwargs)
             callback(cbw)
-        for key in self._frb.keys():
+        for key in self.frb.keys():
             if key not in keys:
-                del self._frb[key]
+                del self.frb[key]
 
     @invalidate_plot
     @invalidate_figure


https://bitbucket.org/yt_analysis/yt/commits/f58bc8d117c5/
Changeset:   f58bc8d117c5
Branch:      yt-3.0
User:        xarthisius
Date:        2014-05-04 22:14:41
Summary:     Merged in smumford/yt/yt-3.0 (pull request #872)

Change ImagePlotContainer._frb to ImagePlotContainer.frb
Affected #:  2 files

diff -r 3abfa256995512a5f3f6a0641c4bc5937762a943 -r f58bc8d117c59ac9e7f1a5db1fea5201d41d025a yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -270,15 +270,15 @@
         return self.plots[item]
 
     def run_callbacks(self, f):
-        keys = self._frb.keys()
+        keys = self.frb.keys()
         for name, (args, kwargs) in self._callbacks:
-            cbw = CallbackWrapper(self, self.plots[f], self._frb, f)
+            cbw = CallbackWrapper(self, self.plots[f], self.frb, f)
             CallbackMaker = callback_registry[name]
             callback = CallbackMaker(*args[1:], **kwargs)
             callback(cbw)
-        for key in self._frb.keys():
+        for key in self.frb.keys():
             if key not in keys:
-                del self._frb[key]
+                del self.frb[key]
 
     @invalidate_plot
     @invalidate_figure

diff -r 3abfa256995512a5f3f6a0641c4bc5937762a943 -r f58bc8d117c59ac9e7f1a5db1fea5201d41d025a yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -264,7 +264,7 @@
         including the margins but not the colorbar.
 
     """
-    _frb = None
+    frb = None
     def __init__(self, data_source, bounds, buff_size=(800,800), antialias=True,
                  periodic=True, origin='center-window', oblique=False,
                  window_size=8.0, fields=None, fontsize=18, setup=False):
@@ -294,7 +294,7 @@
                       range(len(self.data_source.center))
                       if i != self.data_source.axis]
             self.set_center(center)
-        for field in self._frb.data.keys():
+        for field in self.frb.data.keys():
             finfo = self.data_source.pf._get_field_info(*field)
             if finfo.take_log:
                 self._field_transform[field] = log_transform
@@ -322,27 +322,27 @@
 
     def _recreate_frb(self):
         old_fields = None
-        if self._frb is not None:
-            old_fields = self._frb.keys()
-            old_units = [str(self._frb[of].units) for of in old_fields]
+        if self.frb is not None:
+            old_fields = self.frb.keys()
+            old_units = [str(self.frb[of].units) for of in old_fields]
         if hasattr(self,'zlim'):
             bounds = self.xlim+self.ylim+self.zlim
         else:
             bounds = self.xlim+self.ylim
         if self._frb_generator is ObliqueFixedResolutionBuffer:
             bounds = np.array(bounds)
-        self._frb = self._frb_generator(self.data_source,
+        self.frb = self._frb_generator(self.data_source,
                                         bounds, self.buff_size,
                                         self.antialias,
                                         periodic=self._periodic)
         if old_fields is None:
-            self._frb._get_data_source_fields()
+            self.frb._get_data_source_fields()
         else:
             for key, unit in zip(old_fields, old_units):
-                self._frb[key]
-                self._frb[key].convert_to_units(unit)
+                self.frb[key]
+                self.frb[key].convert_to_units(unit)
         for key in self.override_fields:
-            self._frb[key]
+            self.frb[key]
         self._data_valid = True
 
     @property
@@ -442,7 +442,7 @@
                 "Field list {} and unit "
                 "list {} are incompatible".format(field, new_unit))
         for f, u in zip(field, new_unit):
-            self._frb[f].convert_to_units(u)
+            self.frb[f].convert_to_units(u)
         return self
 
     @invalidate_data
@@ -513,7 +513,7 @@
 
         axes_unit = get_axes_unit(width, self.pf)
 
-        width = get_sanitized_width(self._frb.axis, width, None, self.pf)
+        width = get_sanitized_width(self.frb.axis, width, None, self.pf)
 
         centerx = (self.xlim[1] + self.xlim[0])/2.
         centery = (self.ylim[1] + self.ylim[0])/2.
@@ -744,7 +744,7 @@
             else:
                 zlim = (None, None)
 
-            image = self._frb[f]
+            image = self.frb[f]
 
             if image.max() == image.min():
               if self._field_transform[f] == log_transform:
@@ -828,7 +828,7 @@
             colorbar_label = image.info['label']
 
             # Determine the units of the data
-            units = Unit(self._frb[f].units, registry=self.pf.unit_registry)
+            units = Unit(self.frb[f].units, registry=self.pf.unit_registry)
             units = units.latex_representation()
 
             if units is None or units == '':
@@ -1373,14 +1373,14 @@
             addl_keys = {'type': 'widget_payload',
                          'widget_id': self._ext_widget_id}
         else:
-            fields = self._frb.data.keys()
+            fields = self.frb.data.keys()
             addl_keys = {}
         if self._colorbar_valid == False:
             addl_keys['colorbar_image'] = self._get_cbar_image()
             self._colorbar_valid = True
         min_zoom = 200*self.pf.index.get_smallest_dx() * self.pf['unitary']
         for field in fields:
-            to_plot = apply_colormap(self._frb[field],
+            to_plot = apply_colormap(self.frb[field],
                 func = self._field_transform[field],
                 cmap_name = self._colormaps[field])
             pngs = self._apply_modifications(to_plot)
@@ -1429,8 +1429,8 @@
         field, number, colors, logit = self._contour_info
         if colors is not None: plot_args['colors'] = colors
 
-        raw_data = self._frb.data_source
-        b = self._frb.bounds
+        raw_data = self.frb.data_source
+        b = self.frb.bounds
         xi, yi = np.mgrid[b[0]:b[1]:(vi / 8) * 1j,
                           b[2]:b[3]:(vj / 8) * 1j]
         x = raw_data['px']
@@ -1445,15 +1445,15 @@
         if self._vector_info is None: return
         skip, scale = self._vector_info
 
-        nx = self._frb.buff_size[0]/skip
-        ny = self._frb.buff_size[1]/skip
-        new_frb = FixedResolutionBuffer(self._frb.data_source,
-                        self._frb.bounds, (nx,ny))
+        nx = self.frb.buff_size[0]/skip
+        ny = self.frb.buff_size[1]/skip
+        new_frb = FixedResolutionBuffer(self.frb.data_source,
+                        self.frb.bounds, (nx,ny))
 
-        axis = self._frb.data_source.axis
-        xax = self._frb.data_source.pf.coordinates.x_axis[axis]
-        yax = self._frb.data_source.pf.coordinates.y_axis[axis]
-        axis_names = self._frb.data_source.pf.coordinates.axis_name
+        axis = self.frb.data_source.axis
+        xax = self.frb.data_source.pf.coordinates.x_axis[axis]
+        yax = self.frb.data_source.pf.coordinates.y_axis[axis]
+        axis_names = self.frb.data_source.pf.coordinates.axis_name
         fx = "velocity_%s" % (axis_names[xax])
         fy = "velocity_%x" % (axis_names[yax])
         px = new_frb[fx][::-1,:]
@@ -1471,7 +1471,7 @@
         # This will eventually change to work with non-logged fields
         ticks = []
         transform = self._field_transform[field]
-        mi, ma = self._frb[field].min(), self._frb[field].max()
+        mi, ma = self.frb[field].min(), self.frb[field].max()
         tick_locs = transform.ticks(mi, ma)
         mi, ma = transform((mi, ma))
         for v1,v2 in zip(tick_locs, transform(tick_locs)):
@@ -1509,7 +1509,7 @@
         self.set_center((new_x, new_y))
 
     def get_field_units(self, field, strip_mathml = True):
-        ds = self._frb.data_source
+        ds = self.frb.data_source
         pf = self.pf
         field = self._check_field(field)
         finfo = self.data_source.pf._get_field_info(*field)
@@ -1527,7 +1527,7 @@
         return units
 
     def get_metadata(self, field, strip_mathml = True, return_string = True):
-        fval = self._frb[field]
+        fval = self.frb[field]
         mi = fval.min()
         ma = fval.max()
         x_width = self.xlim[1] - self.xlim[0]
@@ -1538,10 +1538,10 @@
         else:
             unit = self._axes_unit_names
         units = self.get_field_units(field, strip_mathml)
-        center = getattr(self._frb.data_source, "center", None)
-        xax = self.pf.coordinates.x_axis[self._frb.axis]
-        yax = self.pf.coordinates.y_axis[self._frb.axis]
-        if center is None or self._frb.axis == 4:
+        center = getattr(self.frb.data_source, "center", None)
+        xax = self.pf.coordinates.x_axis[self.frb.axis]
+        yax = self.pf.coordinates.y_axis[self.frb.axis]
+        if center is None or self.frb.axis == 4:
             xc, yc, zc = -999, -999, -999
         else:
             center[xax] = 0.5 * (
@@ -1580,7 +1580,7 @@
     def set_current_field(self, field):
         field = self._check_field(field)
         self._current_field = field
-        self._frb[field]
+        self.frb[field]
         finfo = self.data_source.pf._get_field_info(*field)
         if finfo.take_log:
             self._field_transform[field] = log_transform

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