[yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Jul 11 16:40:00 PDT 2012
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/52f2f081c157/
changeset: 52f2f081c157
branch: yt
user: ngoldbaum
date: 2012-07-11 07:04:03
summary: Updating the docstrings for the callbacks.
affected #: 2 files
diff -r 5c7b2095ee5a1efe4ffcb0a88bb03a256768e575 -r 52f2f081c15704e3b0d4f95b6e43f69da785b9b1 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
@@ -461,6 +477,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 +497,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 +539,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 +583,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 +632,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 +656,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 +679,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 +704,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 +746,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 +804,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 +952,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 +986,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 +1064,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 5c7b2095ee5a1efe4ffcb0a88bb03a256768e575 -r 52f2f081c15704e3b0d4f95b6e43f69da785b9b1 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):
https://bitbucket.org/yt_analysis/yt/changeset/22ff2615e98c/
changeset: 22ff2615e98c
branch: yt
user: MatthewTurk
date: 2012-07-12 01:39:59
summary: Merged in ngoldbaum/yt-ngoldbaum (pull request #196)
affected #: 2 files
diff -r 94b06429c80a903f95cf2abe0f54877d251ed13c -r 22ff2615e98ca1af7612abec8b231491fd5d705e 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
@@ -461,6 +477,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 +497,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 +539,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 +583,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 +632,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 +656,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 +679,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 +704,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 +746,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 +804,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 +952,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 +986,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 +1064,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 94b06429c80a903f95cf2abe0f54877d251ed13c -r 22ff2615e98ca1af7612abec8b231491fd5d705e 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