[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Apr 30 20:42:03 PDT 2013
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/be0a96c06b28/
Changeset: be0a96c06b28
Branch: yt
User: ngoldbaum
Date: 2013-04-29 03:15:30
Summary: Adding a data_source keyword for ProjectionPlot
Affected #: 2 files
diff -r ba9d67fad65a642c0a0c6c621fee5fdf8139d765 -r be0a96c06b2809151aaf2ebede1873b46dc98670 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -1221,6 +1221,9 @@
('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window')
================================== ============================
+ data_source : AMR3DData Object
+ Object to be used for data selection. Defaults to a region covering the
+ entire simulation.
weight_field : string
The name of the weighting field. Set to None for no weight.
max_level: int
@@ -1245,7 +1248,7 @@
def __init__(self, pf, axis, fields, center='c', width=None, axes_unit=None,
weight_field=None, max_level=None, origin='center-window', fontsize=18,
- field_parameters=None):
+ field_parameters=None, data_source=None):
ts = self._initialize_dataset(pf)
self.ts = ts
pf = self.pf = ts[0]
@@ -1255,7 +1258,7 @@
axes_unit = units
if field_parameters is None: field_parameters = {}
proj = pf.h.proj(axis, fields, weight_field=weight_field, max_level=max_level,
- center=center, **field_parameters)
+ center=center, source=data_source, **field_parameters)
PWViewerMPL.__init__(self, proj, bounds, origin=origin, fontsize=fontsize)
self.set_axes_unit(axes_unit)
diff -r ba9d67fad65a642c0a0c6c621fee5fdf8139d765 -r be0a96c06b2809151aaf2ebede1873b46dc98670 yt/visualization/tests/test_plotwindow.py
--- a/yt/visualization/tests/test_plotwindow.py
+++ b/yt/visualization/tests/test_plotwindow.py
@@ -160,6 +160,8 @@
test_flnms = [None, 'test.png', 'test.eps',
'test.ps', 'test.pdf']
+ ds_region = test_pf.h.region([0.5]*3,[0.4]*3,[0.6]*3)
+
for dim in [0, 1, 2]:
obj = SlicePlot(test_pf, dim, 'Density')
for fname in test_flnms:
@@ -169,6 +171,10 @@
obj = ProjectionPlot(test_pf, dim, 'Density')
for fname in test_flnms:
yield assert_equal, assert_fname(obj.save(fname)[0]), True
+ # Test ProjectionPlot's data_source keyword
+ obj = ProjectionPlot(test_pf, dim, 'Density',
+ data_source=ds_region)
+ obj.save()
obj = OffAxisSlicePlot(test_pf, normal, 'Density')
for fname in test_flnms:
https://bitbucket.org/yt_analysis/yt/commits/8da80188ed68/
Changeset: 8da80188ed68
Branch: yt
User: MatthewTurk
Date: 2013-05-01 05:41:56
Summary: Merged in ngoldbaum/yt (pull request #485)
Adding a data_source keyword for ProjectionPlot
Affected #: 2 files
diff -r aa91cc1e668b20685bab877e42e5f8ed61292d99 -r 8da80188ed6862e0bf9e04dab41b726bb7df8b97 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -1229,6 +1229,9 @@
('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window')
================================== ============================
+ data_source : AMR3DData Object
+ Object to be used for data selection. Defaults to a region covering the
+ entire simulation.
weight_field : string
The name of the weighting field. Set to None for no weight.
max_level: int
@@ -1253,7 +1256,7 @@
def __init__(self, pf, axis, fields, center='c', width=None, axes_unit=None,
weight_field=None, max_level=None, origin='center-window', fontsize=18,
- field_parameters=None):
+ field_parameters=None, data_source=None):
ts = self._initialize_dataset(pf)
self.ts = ts
pf = self.pf = ts[0]
@@ -1263,7 +1266,7 @@
axes_unit = units
if field_parameters is None: field_parameters = {}
proj = pf.h.proj(axis, fields, weight_field=weight_field, max_level=max_level,
- center=center, **field_parameters)
+ center=center, source=data_source, **field_parameters)
PWViewerMPL.__init__(self, proj, bounds, origin=origin, fontsize=fontsize)
self.set_axes_unit(axes_unit)
diff -r aa91cc1e668b20685bab877e42e5f8ed61292d99 -r 8da80188ed6862e0bf9e04dab41b726bb7df8b97 yt/visualization/tests/test_plotwindow.py
--- a/yt/visualization/tests/test_plotwindow.py
+++ b/yt/visualization/tests/test_plotwindow.py
@@ -160,6 +160,8 @@
test_flnms = [None, 'test.png', 'test.eps',
'test.ps', 'test.pdf']
+ ds_region = test_pf.h.region([0.5]*3,[0.4]*3,[0.6]*3)
+
for dim in [0, 1, 2]:
obj = SlicePlot(test_pf, dim, 'Density')
for fname in test_flnms:
@@ -169,6 +171,10 @@
obj = ProjectionPlot(test_pf, dim, 'Density')
for fname in test_flnms:
yield assert_equal, assert_fname(obj.save(fname)[0]), True
+ # Test ProjectionPlot's data_source keyword
+ obj = ProjectionPlot(test_pf, dim, 'Density',
+ data_source=ds_region)
+ obj.save()
obj = OffAxisSlicePlot(test_pf, normal, 'Density')
for fname in test_flnms:
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