[yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Fri Aug 3 15:15:36 PDT 2012
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/e185e61e4171/
changeset: e185e61e4171
branch: yt
user: ngoldbaum
date: 2012-08-04 00:14:15
summary: Fixing a bug pointed out on the mailing list by Sherwood Richers.
affected #: 1 file
diff -r 3c2ce08a863303a80b057f8f9fba38af0866b5b6 -r e185e61e4171d788ca5c2643d483acd3f5f5d2a7 yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -1236,7 +1236,7 @@
plt = SlicePlot(pf, ax, args.field, center=center,
width=width)
if args.grids:
- plt.draw_grids()
+ plt.annotate_grids()
if args.time:
time = pf.current_time*pf['Time']*pf['years']
plt.annotate_text((0.2,0.8), 't = %5.2e yr'%time)
https://bitbucket.org/yt_analysis/yt/changeset/b950249e356e/
changeset: b950249e356e
branch: yt
user: ngoldbaum
date: 2012-08-04 00:14:50
summary: Merging
affected #: 6 files
diff -r e185e61e4171d788ca5c2643d483acd3f5f5d2a7 -r b950249e356e67e8c101606a73cc43fdbc9bfe79 setup.py
--- a/setup.py
+++ b/setup.py
@@ -106,7 +106,7 @@
import setuptools
-VERSION = "2.4dev"
+VERSION = "2.5dev"
if os.path.exists('MANIFEST'): os.remove('MANIFEST')
diff -r e185e61e4171d788ca5c2643d483acd3f5f5d2a7 -r b950249e356e67e8c101606a73cc43fdbc9bfe79 yt/analysis_modules/cosmological_observation/cosmology_splice.py
--- a/yt/analysis_modules/cosmological_observation/cosmology_splice.py
+++ b/yt/analysis_modules/cosmological_observation/cosmology_splice.py
@@ -184,7 +184,23 @@
mylog.info("create_cosmology_splice: Used %d data dumps to get from z = %f to %f." %
(len(cosmology_splice), far_redshift, near_redshift))
-
+
+ # change the 'next' and 'previous' pointers to point to the correct outputs for the created
+ # splice
+ for i, output in enumerate(cosmology_splice):
+ if len(cosmology_splice) == 1:
+ output['previous'] = None
+ output['next'] = None
+ elif i == 0:
+ output['previous'] = None
+ output['next'] = cosmology_splice[i + 1]
+ elif i == len(cosmology_splice) - 1:
+ output['previous'] = cosmology_splice[i - 1]
+ output['next'] = None
+ else:
+ output['previous'] = cosmology_splice[i - 1]
+ output['next'] = cosmology_splice[i + 1]
+
self.splice_outputs.sort(key=lambda obj: obj['time'])
return cosmology_splice
diff -r e185e61e4171d788ca5c2643d483acd3f5f5d2a7 -r b950249e356e67e8c101606a73cc43fdbc9bfe79 yt/utilities/lib/grid_traversal.pyx
--- a/yt/utilities/lib/grid_traversal.pyx
+++ b/yt/utilities/lib/grid_traversal.pyx
@@ -691,7 +691,7 @@
malloc(sizeof(FieldInterpolationTable) * 6)
self.vra.n_fits = tf_obj.n_field_tables
assert(self.vra.n_fits <= 6)
- self.vra.grey_opacity = tf_obj.grey_opacity
+ self.vra.grey_opacity = getattr(tf_obj, "grey_opacity", 0)
self.vra.n_samples = n_samples
self.my_field_tables = []
for i in range(self.vra.n_fits):
@@ -757,7 +757,7 @@
malloc(sizeof(FieldInterpolationTable) * 6)
self.vra.n_fits = tf_obj.n_field_tables
assert(self.vra.n_fits <= 6)
- self.vra.grey_opacity = tf_obj.grey_opacity
+ self.vra.grey_opacity = getattr(tf_obj, "grey_opacity", 0)
self.vra.n_samples = n_samples
self.vra.light_dir = <np.float64_t *> malloc(sizeof(np.float64_t) * 3)
self.vra.light_rgba = <np.float64_t *> malloc(sizeof(np.float64_t) * 4)
diff -r e185e61e4171d788ca5c2643d483acd3f5f5d2a7 -r b950249e356e67e8c101606a73cc43fdbc9bfe79 yt/utilities/minimal_representation.py
--- a/yt/utilities/minimal_representation.py
+++ b/yt/utilities/minimal_representation.py
@@ -99,6 +99,8 @@
for i in metadata:
if isinstance(metadata[i], na.ndarray):
metadata[i] = metadata[i].tolist()
+ elif hasattr(metadata[i], 'dtype'):
+ metadata[i] = na.asscalar(metadata[i])
metadata['obj_type'] = self.type
if len(chunks) == 0:
chunk_info = {'chunks': []}
diff -r e185e61e4171d788ca5c2643d483acd3f5f5d2a7 -r b950249e356e67e8c101606a73cc43fdbc9bfe79 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -179,8 +179,7 @@
center = na.dot(mat,center)
width = width/pf.domain_width.min()
- bounds = [center[0]-width[0]/2,center[0]+width[0]/2,
- center[1]-width[1]/2,center[1]+width[1]/2]
+ bounds = [-width[0]/2, width[0]/2, -width[1]/2, width[1]/2]
return (bounds,center)
@@ -551,7 +550,7 @@
pf = self.pf
if ds._type_name in ("slice", "cutting"):
units = pf.field_info[field].get_units()
- if ds._type_name == "proj" and (ds.weight_field is not None or
+ elif ds._type_name == "proj" and (ds.weight_field is not None or
ds.proj_style == "mip"):
units = pf.field_info[field].get_units()
elif ds._type_name == "proj":
diff -r e185e61e4171d788ca5c2643d483acd3f5f5d2a7 -r b950249e356e67e8c101606a73cc43fdbc9bfe79 yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -823,14 +823,14 @@
# This assumes Density; this is a relatively safe assumption.
import matplotlib.figure
import matplotlib.backends.backend_agg
- phi, theta = na.mgrid[0.0:2*pi:800j, 0:pi:800j]
+ phi, theta = na.mgrid[0.0:2*na.pi:800j, 0:na.pi:800j]
pixi = arr_ang2pix_nest(self.nside, theta.ravel(), phi.ravel())
image *= self.radius * self.pf['cm']
img = na.log10(image[:,0,0][pixi]).reshape((800,800))
fig = matplotlib.figure.Figure((10, 5))
ax = fig.add_subplot(1,1,1,projection='hammer')
- implot = ax.imshow(img, extent=(-pi,pi,-pi/2,pi/2), clip_on=False, aspect=0.5)
+ implot = ax.imshow(img, extent=(-na.pi,na.pi,-na.pi/2,na.pi/2), clip_on=False, aspect=0.5)
cb = fig.colorbar(implot, orientation='horizontal')
cb.set_label(r"$\mathrm{log}\/\mathrm{Column}\/\mathrm{Density}\/[\mathrm{g}/\mathrm{cm}^2]$")
if clim is not None: cb.set_clim(*clim)
@@ -1460,6 +1460,8 @@
vs2 = vs.copy()
for i in range(3):
vs[:,:,i] = (vs2 * rotation[:,i]).sum(axis=2)
+ else:
+ vs += 1e-8
positions = na.ones((nv, 1, 3), dtype='float64', order='C') * center
dx = min(g.dds.min() for g in pf.h.find_point(center)[0])
positions += inner_radius * dx * vs
@@ -1490,7 +1492,7 @@
for g in pf.h.grids:
if "temp_weightfield" in g.keys():
del g["temp_weightfield"]
- return image
+ return image[:,0,0]
def plot_allsky_healpix(image, nside, fn, label = "", rotation = None,
take_log = True, resolution=512):
@@ -1504,7 +1506,8 @@
ax = fig.add_subplot(1,1,1,projection='aitoff')
if take_log: func = na.log10
else: func = lambda a: a
- implot = ax.imshow(func(img), extent=(-pi,pi,-pi/2,pi/2), clip_on=False, aspect=0.5)
+ implot = ax.imshow(func(img), extent=(-na.pi,na.pi,-na.pi/2,na.pi/2),
+ clip_on=False, aspect=0.5)
cb = fig.colorbar(implot, orientation='horizontal')
cb.set_label(label)
ax.xaxis.set_ticks(())
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