[yt-svn] commit/yt-3.0: MatthewTurk: Old-style profiles work. Removing all references to lazy_reader.
Bitbucket
commits-noreply at bitbucket.org
Thu Aug 2 12:56:27 PDT 2012
1 new commit in yt-3.0:
https://bitbucket.org/yt_analysis/yt-3.0/changeset/5d48371800a3/
changeset: 5d48371800a3
branch: yt-3.0
user: MatthewTurk
date: 2012-08-02 21:54:00
summary: Old-style profiles work. Removing all references to lazy_reader.
affected #: 8 files
diff -r 78dc1755995073c6fecd814182c8ae4ba28e1c6f -r 5d48371800a335bba2aa55a7c7f46726ed0ca039 yt/analysis_modules/halo_profiler/centering_methods.py
--- a/yt/analysis_modules/halo_profiler/centering_methods.py
+++ b/yt/analysis_modules/halo_profiler/centering_methods.py
@@ -43,14 +43,12 @@
@add_function("Min_Dark_Matter_Density")
def find_minimum_dm_density(data):
ma, maxi, mx, my, mz, mg = data.quantities['MinLocation']('Dark_Matter_Density',
- lazy_reader=True,
preload=False)
return (mx, my, mz)
@add_function("Max_Dark_Matter_Density")
def find_maximum_dm_density(data):
ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('Dark_Matter_Density',
- lazy_reader=True,
preload=False)
return (mx, my, mz)
@@ -58,7 +56,6 @@
def find_CoM_dm_density(data):
dc_x, dc_y, dc_z = data.quantities['CenterOfMass'](use_cells=False,
use_particles=True,
- lazy_reader=True,
preload=False)
return (dc_x, dc_y, dc_z)
@@ -67,14 +64,12 @@
@add_function("Min_Gas_Density")
def find_minimum_gas_density(data):
ma, maxi, mx, my, mz, mg = data.quantities['MinLocation']('Density',
- lazy_reader=True,
preload=False)
return (mx, my, mz)
@add_function("Max_Gas_Density")
def find_maximum_gas_density(data):
ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('Density',
- lazy_reader=True,
preload=False)
return (mx, my, mz)
@@ -82,7 +77,6 @@
def find_CoM_gas_density(data):
dc_x, dc_y, dc_z = data.quantities['CenterOfMass'](use_cells=True,
use_particles=False,
- lazy_reader=True,
preload=False)
return (dc_x, dc_y, dc_z)
@@ -91,14 +85,12 @@
@add_function("Min_Total_Density")
def find_minimum_total_density(data):
ma, maxi, mx, my, mz, mg = data.quantities['MinLocation']('Matter_Density',
- lazy_reader=True,
preload=False)
return (mx, my, mz)
@add_function("Max_Total_Density")
def find_maximum_total_density(data):
ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('Matter_Density',
- lazy_reader=True,
preload=False)
return (mx, my, mz)
@@ -106,7 +98,6 @@
def find_CoM_total_density(data):
dc_x, dc_y, dc_z = data.quantities['CenterOfMass'](use_cells=True,
use_particles=True,
- lazy_reader=True,
preload=False)
return (dc_x, dc_y, dc_z)
@@ -115,14 +106,12 @@
@add_function("Min_Temperature")
def find_minimum_temperature(data):
ma, mini, mx, my, mz, mg = data.quantities['MinLocation']('Temperature',
- lazy_reader=True,
preload=False)
return (mx, my, mz)
@add_function("Max_Temperature")
def find_maximum_temperature(data):
ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('Temperature',
- lazy_reader=True,
preload=False)
return (mx, my, mz)
diff -r 78dc1755995073c6fecd814182c8ae4ba28e1c6f -r 5d48371800a335bba2aa55a7c7f46726ed0ca039 yt/analysis_modules/halo_profiler/multi_halo_profiler.py
--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py
@@ -587,8 +587,7 @@
try:
profile = BinnedProfile1D(sphere, self.n_profile_bins, "RadiusMpc",
r_min, halo['r_max'],
- log_space=True, lazy_reader=True,
- end_collect=True)
+ log_space=True, end_collect=True)
except EmptyProfileData:
mylog.error("Caught EmptyProfileData exception, returning None for this halo.")
return None
@@ -674,15 +673,14 @@
elif self.velocity_center[1] == 'sphere':
mylog.info('Calculating sphere bulk velocity.')
sphere.set_field_parameter('bulk_velocity',
- sphere.quantities['BulkVelocity'](lazy_reader=True,
- preload=False))
+ sphere.quantities['BulkVelocity']()
else:
mylog.error("Invalid parameter: velocity_center.")
return None
elif self.velocity_center[0] == 'max':
mylog.info('Setting bulk velocity with value at max %s.' % self.velocity_center[1])
- max_val, maxi, mx, my, mz, mg = sphere.quantities['MaxLocation'](self.velocity_center[1],
- lazy_reader=True)
+ max_val, maxi, mx, my, mz, mg = sphere.quantities['MaxLocation'](self.velocity_center[1])
+
max_grid = self.pf.h.grids[mg]
max_cell = na.unravel_index(maxi, max_grid.ActiveDimensions)
sphere.set_field_parameter('bulk_velocity', [max_grid['x-velocity'][max_cell],
diff -r 78dc1755995073c6fecd814182c8ae4ba28e1c6f -r 5d48371800a335bba2aa55a7c7f46726ed0ca039 yt/analysis_modules/halo_profiler/standard_analysis.py
--- a/yt/analysis_modules/halo_profiler/standard_analysis.py
+++ b/yt/analysis_modules/halo_profiler/standard_analysis.py
@@ -51,8 +51,7 @@
# inner_bound in cm, outer_bound in same
# Note that in some cases, we will need to massage this object.
prof = BinnedProfile1D(self.obj, self.n_bins, "Radius",
- self.inner_radius, self.outer_radius,
- lazy_reader = True)
+ self.inner_radius, self.outer_radius)
by_weights = defaultdict(list)
for fspec in analysis_field_list:
if isinstance(fspec, types.TupleType) and len(fspec) == 2:
diff -r 78dc1755995073c6fecd814182c8ae4ba28e1c6f -r 5d48371800a335bba2aa55a7c7f46726ed0ca039 yt/data_objects/analyzer_objects.py
--- a/yt/data_objects/analyzer_objects.py
+++ b/yt/data_objects/analyzer_objects.py
@@ -63,7 +63,7 @@
@analysis_task(('field',))
def MaximumValue(params, data_object):
v = data_object.quantities["MaxLocation"](
- params.field, lazy_reader=True)[0]
+ params.field)[0]
return v
@analysis_task()
diff -r 78dc1755995073c6fecd814182c8ae4ba28e1c6f -r 5d48371800a335bba2aa55a7c7f46726ed0ca039 yt/data_objects/profiles.py
--- a/yt/data_objects/profiles.py
+++ b/yt/data_objects/profiles.py
@@ -96,7 +96,7 @@
chunk_fields = fields[:]
if weight is not None: chunk_fields += [weight]
#pbar = get_pbar('Binning grids', len(self._data_source._grids))
- for ds in self._data_source.chunks(chunk_fields, chunking_style = "grids"):
+ for ds in self._data_source.chunks(chunk_fields, chunking_style = "io"):
try:
args = self._get_bins(ds, check_cut=True)
except EmptyProfileData:
diff -r 78dc1755995073c6fecd814182c8ae4ba28e1c6f -r 5d48371800a335bba2aa55a7c7f46726ed0ca039 yt/visualization/easy_plots.py
--- a/yt/visualization/easy_plots.py
+++ b/yt/visualization/easy_plots.py
@@ -55,10 +55,9 @@
self.data_source = data_source
# Now we just make the plot
x_min, x_max = self.data_source.quantities["Extrema"](
- x_field, non_zero = x_log, lazy_reader = True)[0]
+ x_field, non_zero = x_log)[0]
self.profile = BinnedProfile1D(self.data_source,
- n_bins, self.x_field, x_min, x_max, x_log,
- lazy_reader = True)
+ n_bins, self.x_field, x_min, x_max, x_log)
self.profile.add_fields(["CellMassMsun"], weight=None)
self.profile["CellMassMsun"] /= self.profile["CellMassMsun"].sum()
self.figure = matplotlib.figure.Figure(**figure_args)
diff -r 78dc1755995073c6fecd814182c8ae4ba28e1c6f -r 5d48371800a335bba2aa55a7c7f46726ed0ca039 yt/visualization/plot_collection.py
--- a/yt/visualization/plot_collection.py
+++ b/yt/visualization/plot_collection.py
@@ -885,8 +885,7 @@
def add_profile_object(self, data_source, fields,
weight="CellMassMsun", accumulation=False,
x_bins=128, x_log=True, x_bounds=None,
- lazy_reader=True, id=None,
- figure=None, axes=None):
+ id=None, figure=None, axes=None):
r"""From an existing object, create a 1D, binned profile.
This function will accept an existing `YTDataContainer` source and from that,
@@ -923,11 +922,6 @@
If specified, the boundary values for the binning. If unspecified,
the min/max from the data_source will be used. (Non-zero min/max
in case of log-spacing.)
- lazy_reader : boolean, optional
- If this is false, all of the data will be read into memory before
- any processing occurs. It defaults to true, and grids are binned
- on a one-by-one basis. Note that parallel computation requires
- this to be true.
id : int, optional
If specified, this will be the "semi-unique id" of the resultant
plot. This should not be set.
@@ -958,13 +952,11 @@
"""
if x_bounds is None:
x_min, x_max = data_source.quantities["Extrema"](
- fields[0], non_zero = x_log,
- lazy_reader=lazy_reader)[0]
+ fields[0], non_zero = x_log)[0]
else:
x_min, x_max = x_bounds
profile = BinnedProfile1D(data_source,
- x_bins, fields[0], x_min, x_max, x_log,
- lazy_reader)
+ x_bins, fields[0], x_min, x_max, x_log)
if len(fields) > 1:
profile.add_fields(fields[1:], weight=weight, accumulation=accumulation)
if id is None: id = self._get_new_id()
@@ -975,8 +967,7 @@
def add_profile_sphere(self, radius, unit, fields, center = None,
weight="CellMassMsun", accumulation=False,
x_bins=128, x_log=True, x_bounds=None,
- lazy_reader=True, id=None,
- figure=None, axes=None):
+ id=None, figure=None, axes=None):
r"""From a description of a sphere, create a 1D, binned profile.
This function will accept the radius of a sphere, and from that it will
@@ -1016,11 +1007,6 @@
If specified, the boundary values for the binning. If unspecified,
the min/max from the data_source will be used. (Non-zero min/max
in case of log-spacing.)
- lazy_reader : boolean, optional
- If this is false, all of the data will be read into memory before
- any processing occurs. It defaults to true, and grids are binned
- on a one-by-one basis. Note that parallel computation requires
- this to be true.
id : int, optional
If specified, this will be the "semi-unique id" of the resultant
plot. This should not be set.
@@ -1055,7 +1041,7 @@
r = radius/self.pf[unit]
sphere = self.pf.hierarchy.sphere(center, r)
p = self.add_profile_object(sphere, fields, weight, accumulation,
- x_bins, x_log, x_bounds, lazy_reader, id,
+ x_bins, x_log, x_bounds, id,
figure=figure, axes=axes)
p["Width"] = radius
p["Unit"] = unit
@@ -1066,8 +1052,7 @@
weight="CellMassMsun", accumulation=False,
x_bins=128, x_log=True, x_bounds=None,
y_bins=128, y_log=True, y_bounds=None,
- lazy_reader=True, id=None,
- axes = None, figure = None,
+ id=None, axes = None, figure = None,
fractional=False):
r"""From an existing object, create a 2D, binned profile.
@@ -1119,11 +1104,6 @@
If specified, the boundary values for the binning. If unspecified,
the min/max from the data_source will be used. (Non-zero min/max
in case of log-spacing.)
- lazy_reader : boolean, optional
- If this is false, all of the data will be read into memory before
- any processing occurs. It defaults to true, and grids are binned
- on a one-by-one basis. Note that parallel computation requires
- this to be true.
id : int, optional
If specified, this will be the "semi-unique id" of the resultant
plot. This should not be set.
@@ -1160,20 +1140,17 @@
"""
if x_bounds is None:
x_min, x_max = data_source.quantities["Extrema"](
- fields[0], non_zero = x_log,
- lazy_reader=lazy_reader)[0]
+ fields[0], non_zero = x_log)[0]
else:
x_min, x_max = x_bounds
if y_bounds is None:
y_min, y_max = data_source.quantities["Extrema"](
- fields[1], non_zero = y_log,
- lazy_reader=lazy_reader)[0]
+ fields[1], non_zero = y_log)[0]
else:
y_min, y_max = y_bounds
profile = BinnedProfile2D(data_source,
x_bins, fields[0], x_min, x_max, x_log,
- y_bins, fields[1], y_min, y_max, y_log,
- lazy_reader)
+ y_bins, fields[1], y_min, y_max, y_log)
# This will add all the fields to the profile object
if len(fields)>2:
profile.add_fields(fields[2:], weight=weight,
@@ -1189,8 +1166,7 @@
weight="CellMassMsun", accumulation=False,
x_bins=128, x_log=True, x_bounds=None,
y_bins=128, y_log=True, y_bounds=None,
- lazy_reader=True, id=None,
- axes = None, figure = None,
+ id=None, axes = None, figure = None,
fractional=False):
r"""From a description of a sphere, create a 2D, binned profile.
@@ -1245,11 +1221,6 @@
If specified, the boundary values for the binning. If unspecified,
the min/max from the data_source will be used. (Non-zero min/max
in case of log-spacing.)
- lazy_reader : boolean, optional
- If this is false, all of the data will be read into memory before
- any processing occurs. It defaults to true, and grids are binned
- on a one-by-one basis. Note that parallel computation requires
- this to be true.
id : int, optional
If specified, this will be the "semi-unique id" of the resultant
plot. This should not be set.
@@ -1290,7 +1261,7 @@
weight, accumulation,
x_bins, x_log, x_bounds,
y_bins, y_log, y_bounds,
- lazy_reader, id, axes=axes, figure=figure, fractional=fractional)
+ id, axes=axes, figure=figure, fractional=fractional)
p["Width"] = radius
p["Unit"] = unit
p["Axis"] = None
diff -r 78dc1755995073c6fecd814182c8ae4ba28e1c6f -r 5d48371800a335bba2aa55a7c7f46726ed0ca039 yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -175,7 +175,7 @@
weight="CellMassMsun", accumulation=False,
x_bins=128, x_log=True, x_bounds=None,
y_bins=128, y_log=True, y_bounds=None,
- lazy_reader=True, fractional=False):
+ fractional=False):
r"""From an existing object, create a 2D, binned profile.
This function will accept an existing `YTDataContainer` source and from that,
@@ -226,11 +226,6 @@
If specified, the boundary values for the binning. If unspecified,
the min/max from the data_source will be used. (Non-zero min/max
in case of log-spacing.)
- lazy_reader : boolean, optional
- If this is false, all of the data will be read into memory before
- any processing occurs. It defaults to true, and grids are binned
- on a one-by-one basis. Note that parallel computation requires
- this to be true.
fractional : boolean
If true, the plot will be normalized to the sum of all the binned
values.
@@ -258,20 +253,17 @@
"""
if x_bounds is None:
x_min, x_max = data_source.quantities["Extrema"](
- field_x, non_zero = x_log,
- lazy_reader=lazy_reader)[0]
+ field_x, non_zero = x_log)[0]
else:
x_min, x_max = x_bounds
if y_bounds is None:
y_min, y_max = data_source.quantities["Extrema"](
- field_y, non_zero = y_log,
- lazy_reader=lazy_reader)[0]
+ field_y, non_zero = y_log)[0]
else:
y_min, y_max = y_bounds
profile = BinnedProfile2D(data_source,
x_bins, field_x, x_min, x_max, x_log,
- y_bins, field_y, y_min, y_max, y_log,
- lazy_reader)
+ y_bins, field_y, y_min, y_max, y_log)
# This is a fallback, in case we forget.
if field_z.startswith("CellMass") or \
field_z.startswith("CellVolume"):
@@ -392,16 +384,14 @@
def __init__(self, data_source, field_x, field_y,
weight="CellMassMsun", accumulation=False,
x_bins=128, x_log=True, x_bounds=None,
- lazy_reader=True, fractional=False):
+ fractional=False):
if x_bounds is None:
x_min, x_max = data_source.quantities["Extrema"](
- field_x, non_zero = x_log,
- lazy_reader=lazy_reader)[0]
+ field_x, non_zero = x_log)[0]
else:
x_min, x_max = x_bounds
profile = BinnedProfile1D(data_source,
- x_bins, field_x, x_min, x_max, x_log,
- lazy_reader)
+ x_bins, field_x, x_min, x_max, x_log)
# This is a fallback, in case we forget.
if field_y.startswith("CellMass") or \
field_y.startswith("CellVolume"):
Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/
--
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