[yt-svn] commit/yt: 4 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Jul 14 06:33:48 PDT 2015
4 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/131e80e3a516/
Changeset: 131e80e3a516
Branch: yt
User: MatthewTurk
Date: 2015-03-30 20:10:32+00:00
Summary: Phony commit to break plot window tests.
Affected #: 1 file
diff -r db1ad1f832ed153c2fe34d9d9532c64b04ead41f -r 131e80e3a51689eca27985a18e372bf50328ea68 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -203,7 +203,7 @@
"""
def __init__(self, data_source, bounds, buff_size=(800,800), antialias=True,
- periodic=True, origin='center-window', oblique=False,
+ periodic=True, origin='native', oblique=False,
window_size=8.0, fields=None, fontsize=18, aspect=None,
setup=False):
if not hasattr(self, "ds"):
@@ -1213,7 +1213,7 @@
_frb_generator = FixedResolutionBuffer
def __init__(self, ds, axis, fields, center='c', width=None, axes_unit=None,
- origin='center-window', fontsize=18, field_parameters=None,
+ origin='native', fontsize=18, field_parameters=None,
window_size=8.0, aspect=None, data_source=None):
# this will handle time series data and controllers
ts = self._initialize_dataset(ds)
@@ -1368,7 +1368,7 @@
_frb_generator = FixedResolutionBuffer
def __init__(self, ds, axis, fields, center='c', width=None, axes_unit=None,
- weight_field=None, max_level=None, origin='center-window',
+ weight_field=None, max_level=None, origin='native',
fontsize=18, field_parameters=None, data_source=None,
method = "integrate", proj_style = None, window_size=8.0,
aspect=None):
@@ -1480,7 +1480,7 @@
# Hard-coding the origin keyword since the other two options
# aren't well-defined for off-axis data objects
PWViewerMPL.__init__(self, cutting, bounds, fields=fields,
- origin='center-window',periodic=False,
+ origin='native',periodic=False,
oblique=True, fontsize=fontsize)
if axes_unit is None:
axes_unit = get_axes_unit(width, ds)
@@ -1621,7 +1621,7 @@
# Hard-coding the origin keyword since the other two options
# aren't well-defined for off-axis data objects
PWViewerMPL.__init__(
- self, OffAxisProj, bounds, fields=fields, origin='center-window',
+ self, OffAxisProj, bounds, fields=fields, origin='native',
periodic=False, oblique=True, fontsize=fontsize)
if axes_unit is None:
axes_unit = get_axes_unit(width, ds)
https://bitbucket.org/yt_analysis/yt/commits/1dfbeb5e4dfa/
Changeset: 1dfbeb5e4dfa
Branch: yt
User: MatthewTurk
Date: 2015-03-30 21:03:50+00:00
Summary: Backed out changeset 131e80e3a516
Affected #: 1 file
diff -r 131e80e3a51689eca27985a18e372bf50328ea68 -r 1dfbeb5e4dfa88b472ec3902e31a2f46fdcb5e6f yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -203,7 +203,7 @@
"""
def __init__(self, data_source, bounds, buff_size=(800,800), antialias=True,
- periodic=True, origin='native', oblique=False,
+ periodic=True, origin='center-window', oblique=False,
window_size=8.0, fields=None, fontsize=18, aspect=None,
setup=False):
if not hasattr(self, "ds"):
@@ -1213,7 +1213,7 @@
_frb_generator = FixedResolutionBuffer
def __init__(self, ds, axis, fields, center='c', width=None, axes_unit=None,
- origin='native', fontsize=18, field_parameters=None,
+ origin='center-window', fontsize=18, field_parameters=None,
window_size=8.0, aspect=None, data_source=None):
# this will handle time series data and controllers
ts = self._initialize_dataset(ds)
@@ -1368,7 +1368,7 @@
_frb_generator = FixedResolutionBuffer
def __init__(self, ds, axis, fields, center='c', width=None, axes_unit=None,
- weight_field=None, max_level=None, origin='native',
+ weight_field=None, max_level=None, origin='center-window',
fontsize=18, field_parameters=None, data_source=None,
method = "integrate", proj_style = None, window_size=8.0,
aspect=None):
@@ -1480,7 +1480,7 @@
# Hard-coding the origin keyword since the other two options
# aren't well-defined for off-axis data objects
PWViewerMPL.__init__(self, cutting, bounds, fields=fields,
- origin='native',periodic=False,
+ origin='center-window',periodic=False,
oblique=True, fontsize=fontsize)
if axes_unit is None:
axes_unit = get_axes_unit(width, ds)
@@ -1621,7 +1621,7 @@
# Hard-coding the origin keyword since the other two options
# aren't well-defined for off-axis data objects
PWViewerMPL.__init__(
- self, OffAxisProj, bounds, fields=fields, origin='native',
+ self, OffAxisProj, bounds, fields=fields, origin='center-window',
periodic=False, oblique=True, fontsize=fontsize)
if axes_unit is None:
axes_unit = get_axes_unit(width, ds)
https://bitbucket.org/yt_analysis/yt/commits/2d068f1129cf/
Changeset: 2d068f1129cf
Branch: yt
User: MatthewTurk
Date: 2015-03-30 22:05:24+00:00
Summary: Adding callback tests for answer testing plot windows.
Affected #: 2 files
diff -r 1dfbeb5e4dfa88b472ec3902e31a2f46fdcb5e6f -r 2d068f1129cf164cfd1780c7a4819a93b99fc893 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -662,9 +662,11 @@
class PlotWindowAttributeTest(AnswerTestingTest):
_type_name = "PlotWindowAttribute"
- _attrs = ('plot_type', 'plot_field', 'plot_axis', 'attr_name', 'attr_args')
+ _attrs = ('plot_type', 'plot_field', 'plot_axis', 'attr_name', 'attr_args',
+ 'callback_id')
def __init__(self, ds_fn, plot_field, plot_axis, attr_name, attr_args,
- decimals, plot_type = 'SlicePlot'):
+ decimals, plot_type = 'SlicePlot', callback_id = "",
+ callback_runners = None):
super(PlotWindowAttributeTest, self).__init__(ds_fn)
self.plot_type = plot_type
self.plot_field = plot_field
@@ -673,10 +675,18 @@
self.attr_name = attr_name
self.attr_args = attr_args
self.decimals = decimals
+ # callback_id is so that we don't have to hash the actual callbacks
+ # run, but instead we call them something
+ self.callback_id = callback_id
+ if callback_runners is None:
+ callback_runners = []
+ self.callback_runners = callback_runners
def run(self):
plot = self.create_plot(self.ds, self.plot_type, self.plot_field,
self.plot_axis, self.plot_kwargs)
+ for r in self.callback_runners:
+ r(self, plot)
attr = getattr(plot, self.attr_name)
attr(*self.attr_args[0], **self.attr_args[1])
tmpfd, tmpname = tempfile.mkstemp(suffix='.png')
diff -r 1dfbeb5e4dfa88b472ec3902e31a2f46fdcb5e6f -r 2d068f1129cf164cfd1780c7a4819a93b99fc893 yt/visualization/tests/test_plotwindow.py
--- a/yt/visualization/tests/test_plotwindow.py
+++ b/yt/visualization/tests/test_plotwindow.py
@@ -152,6 +152,28 @@
'mip'
)
+def simple_contour(test_obj, plot):
+ plot.annotate_contour(test_obj.plot_field)
+
+def simple_velocity(test_obj, plot):
+ plot.annotate_velocity()
+
+def simple_streamlines(test_obj, plot):
+ ax = test_obj.plot_axis
+ xax = test_obj.ds.coordinates.x_axis[ax]
+ yax = test_obj.ds.coordinates.y_axis[ax]
+ xn = test_obj.ds.coordinates.axis_name[xax]
+ yn = test_obj.ds.coordinates.axis_name[yax]
+ plot.annotate_streamlines("velocity_%s" % xn,
+ "velocity_%s" % yn)
+
+CALLBACK_TESTS = (
+ ("simple_contour", (simple_contour,)),
+ ("simple_velocity", (simple_velocity,)),
+ #("simple_streamlines", (simple_streamlines,)),
+ #("simple_all", (simple_contour, simple_velocity, simple_streamlines)),
+)
+
@requires_ds(M7)
def test_attributes():
"""Test plot member functions that aren't callbacks"""
@@ -166,6 +188,9 @@
args, decimals)
test_attributes.__name__ = test.description
yield test
+ for n, r in CALLBACK_TESTS:
+ yield PlotWindowAttributeTest(ds, plot_field, ax, attr_name,
+ args, decimals, callback_id=n, callback_runners=r)
@requires_ds(WT)
@@ -179,6 +204,9 @@
for args in ATTR_ARGS[attr_name]:
yield PlotWindowAttributeTest(ds, plot_field, ax, attr_name,
args, decimals)
+ for n, r in CALLBACK_TESTS:
+ yield PlotWindowAttributeTest(ds, plot_field, ax, attr_name,
+ args, decimals, callback_id=n, callback_runners=r)
class TestSetWidth(unittest.TestCase):
https://bitbucket.org/yt_analysis/yt/commits/b7b8cdbad250/
Changeset: b7b8cdbad250
Branch: yt
User: xarthisius
Date: 2015-07-14 13:33:37+00:00
Summary: Merged in MatthewTurk/yt (pull request #1530)
Add callback answer tests
Affected #: 3 files
diff -r c014ad925d83b6f1a7d2124cd941861a87e20d19 -r b7b8cdbad2505dea1391bddbe3ab6e5d65f2e9b6 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -662,9 +662,11 @@
class PlotWindowAttributeTest(AnswerTestingTest):
_type_name = "PlotWindowAttribute"
- _attrs = ('plot_type', 'plot_field', 'plot_axis', 'attr_name', 'attr_args')
+ _attrs = ('plot_type', 'plot_field', 'plot_axis', 'attr_name', 'attr_args',
+ 'callback_id')
def __init__(self, ds_fn, plot_field, plot_axis, attr_name, attr_args,
- decimals, plot_type = 'SlicePlot'):
+ decimals, plot_type = 'SlicePlot', callback_id = "",
+ callback_runners = None):
super(PlotWindowAttributeTest, self).__init__(ds_fn)
self.plot_type = plot_type
self.plot_field = plot_field
@@ -673,10 +675,18 @@
self.attr_name = attr_name
self.attr_args = attr_args
self.decimals = decimals
+ # callback_id is so that we don't have to hash the actual callbacks
+ # run, but instead we call them something
+ self.callback_id = callback_id
+ if callback_runners is None:
+ callback_runners = []
+ self.callback_runners = callback_runners
def run(self):
plot = self.create_plot(self.ds, self.plot_type, self.plot_field,
self.plot_axis, self.plot_kwargs)
+ for r in self.callback_runners:
+ r(self, plot)
attr = getattr(plot, self.attr_name)
attr(*self.attr_args[0], **self.attr_args[1])
tmpfd, tmpname = tempfile.mkstemp(suffix='.png')
diff -r c014ad925d83b6f1a7d2124cd941861a87e20d19 -r b7b8cdbad2505dea1391bddbe3ab6e5d65f2e9b6 yt/visualization/tests/test_plotwindow.py
--- a/yt/visualization/tests/test_plotwindow.py
+++ b/yt/visualization/tests/test_plotwindow.py
@@ -152,6 +152,28 @@
'mip'
)
+def simple_contour(test_obj, plot):
+ plot.annotate_contour(test_obj.plot_field)
+
+def simple_velocity(test_obj, plot):
+ plot.annotate_velocity()
+
+def simple_streamlines(test_obj, plot):
+ ax = test_obj.plot_axis
+ xax = test_obj.ds.coordinates.x_axis[ax]
+ yax = test_obj.ds.coordinates.y_axis[ax]
+ xn = test_obj.ds.coordinates.axis_name[xax]
+ yn = test_obj.ds.coordinates.axis_name[yax]
+ plot.annotate_streamlines("velocity_%s" % xn,
+ "velocity_%s" % yn)
+
+CALLBACK_TESTS = (
+ ("simple_contour", (simple_contour,)),
+ ("simple_velocity", (simple_velocity,)),
+ #("simple_streamlines", (simple_streamlines,)),
+ #("simple_all", (simple_contour, simple_velocity, simple_streamlines)),
+)
+
@requires_ds(M7)
def test_attributes():
"""Test plot member functions that aren't callbacks"""
@@ -166,6 +188,9 @@
args, decimals)
test_attributes.__name__ = test.description
yield test
+ for n, r in CALLBACK_TESTS:
+ yield PlotWindowAttributeTest(ds, plot_field, ax, attr_name,
+ args, decimals, callback_id=n, callback_runners=r)
@requires_ds(WT)
@@ -179,6 +204,9 @@
for args in ATTR_ARGS[attr_name]:
yield PlotWindowAttributeTest(ds, plot_field, ax, attr_name,
args, decimals)
+ for n, r in CALLBACK_TESTS:
+ yield PlotWindowAttributeTest(ds, plot_field, ax, attr_name,
+ args, decimals, callback_id=n, callback_runners=r)
class TestHideAxesColorbar(unittest.TestCase):
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