[yt-svn] commit/yt: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Sep 24 08:34:10 PDT 2013
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/f810c7b20b1b/
Changeset: f810c7b20b1b
Branch: yt
User: ngoldbaum
Date: 2013-09-24 07:13:16
Summary: Making it possible to plot excluded fields. Closes #467.
Affected #: 1 file
diff -r fb0275961059ae14c3ac809686f03edd8dbd6cca -r f810c7b20b1bc633d6aaa49046862db22565f017 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -290,7 +290,8 @@
_vector_info = None
_frb = None
def __init__(self, data_source, bounds, buff_size=(800,800), antialias=True,
- periodic=True, origin='center-window', oblique=False, window_size=10.0):
+ periodic=True, origin='center-window', oblique=False,
+ window_size=10.0, fields=None):
if not hasattr(self, "pf"):
self.pf = data_source.pf
ts = self._initialize_dataset(self.pf)
@@ -304,8 +305,13 @@
self.buff_size = buff_size
self.window_size = window_size
self.antialias = antialias
+ skip = list(FixedResolutionBuffer._exclude_fields) + data_source._key_fields
+ if fields is None:
+ fields = []
+ self.override_fields = list(np.intersect1d(fields, skip))
self.set_window(bounds) # this automatically updates the data and plot
self.origin = origin
+
if self.data_source.center is not None and oblique == False:
center = [self.data_source.center[i] for i in range(len(self.data_source.center))
if i != self.data_source.axis]
@@ -359,6 +365,8 @@
self._frb._get_data_source_fields()
else:
for key in old_fields: self._frb[key]
+ for key in self.override_fields:
+ self._frb[key]
self._data_valid = True
def _setup_plots(self):
@@ -366,7 +374,7 @@
@property
def fields(self):
- return self._frb.data.keys()
+ return self._frb.data.keys() + self.override_fields
@property
def width(self):
@@ -1274,7 +1282,8 @@
axes_unit = units
if field_parameters is None: field_parameters = {}
slc = pf.h.slice(axis, center[axis], center=center, fields=fields, **field_parameters)
- PWViewerMPL.__init__(self, slc, bounds, origin=origin, fontsize=fontsize)
+ PWViewerMPL.__init__(self, slc, bounds, origin=origin,
+ fontsize=fontsize, fields=fields)
self.set_axes_unit(axes_unit)
class ProjectionPlot(PWViewerMPL):
@@ -1391,7 +1400,8 @@
if field_parameters is None: field_parameters = {}
proj = pf.h.proj(axis, fields, weight_field=weight_field, max_level=max_level,
center=center, source=data_source, **field_parameters)
- PWViewerMPL.__init__(self, proj, bounds, origin=origin, fontsize=fontsize)
+ PWViewerMPL.__init__(self, proj, bounds, origin=origin,
+ fontsize=fontsize, fields=fields)
self.set_axes_unit(axes_unit)
class OffAxisSlicePlot(PWViewerMPL):
@@ -1450,8 +1460,9 @@
cutting = pf.h.cutting(normal, center, fields=fields, north_vector=north_vector, **field_parameters)
# Hard-coding the origin keyword since the other two options
# aren't well-defined for off-axis data objects
- PWViewerMPL.__init__(self, cutting, bounds, origin='center-window', periodic=False,
- oblique=True, fontsize=fontsize)
+ PWViewerMPL.__init__(self, cutting, bounds, origin='center-window',
+ periodic=False, oblique=True, fontsize=fontsize,
+ fields=fields)
self.set_axes_unit(axes_unit)
class OffAxisProjectionDummyDataSource(object):
https://bitbucket.org/yt_analysis/yt/commits/ac2f89323c45/
Changeset: ac2f89323c45
Branch: yt
User: ngoldbaum
Date: 2013-09-24 07:28:47
Summary: Need to ensure that fields is a list.
Affected #: 1 file
diff -r f810c7b20b1bc633d6aaa49046862db22565f017 -r ac2f89323c453e701672d44b2dfc0e669b3e2454 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -308,6 +308,8 @@
skip = list(FixedResolutionBuffer._exclude_fields) + data_source._key_fields
if fields is None:
fields = []
+ else:
+ fields = ensure_list(fields)
self.override_fields = list(np.intersect1d(fields, skip))
self.set_window(bounds) # this automatically updates the data and plot
self.origin = origin
https://bitbucket.org/yt_analysis/yt/commits/b154dfce6acc/
Changeset: b154dfce6acc
Branch: yt
User: ngoldbaum
Date: 2013-09-24 07:34:04
Summary: Removing an extraneous carriage return.
Affected #: 1 file
diff -r ac2f89323c453e701672d44b2dfc0e669b3e2454 -r b154dfce6acc5a293d7abfe20d64acc542919627 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -313,7 +313,6 @@
self.override_fields = list(np.intersect1d(fields, skip))
self.set_window(bounds) # this automatically updates the data and plot
self.origin = origin
-
if self.data_source.center is not None and oblique == False:
center = [self.data_source.center[i] for i in range(len(self.data_source.center))
if i != self.data_source.axis]
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