[yt-svn] commit/yt: 5 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Sat May 24 14:31:25 PDT 2014
5 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/d3dedb7b3414/
Changeset: d3dedb7b3414
Branch: yt-3.0
User: mzingale
Date: 2014-05-23 19:26:09
Summary: update to reflect that in an range [a,b] composed of N points, there are
N-1 intervals between them. This gets tick values correct when plotting
the transfer function.
Affected #: 1 file
diff -r 83b72f64df4676f00cfc3b23f57d6317c86e10f5 -r d3dedb7b3414602fea4e4d592b8312b1a8c456bd yt/visualization/volume_rendering/transfer_functions.py
--- a/yt/visualization/volume_rendering/transfer_functions.py
+++ b/yt/visualization/volume_rendering/transfer_functions.py
@@ -469,7 +469,7 @@
xticks *= self.alpha.x.size / (self.alpha.x[-1] - self.alpha.x[0])
ax.xaxis.set_ticks(xticks)
def x_format(x, pos):
- return "%.1f" % (x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size) + self.alpha.x[0])
+ return "%.1f" % (x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size-1) + self.alpha.x[0])
ax.xaxis.set_major_formatter(FuncFormatter(x_format))
yticks = np.linspace(0,1,5) * self.alpha.y.size
ax.yaxis.set_ticks(yticks)
@@ -512,7 +512,7 @@
xticks = xticks[::len(xticks)/5]
ax.xaxis.set_ticks(xticks)
def x_format(x, pos):
- return "%.1f" % (x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size) + self.alpha.x[0])
+ return "%.1f" % (x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size-1) + self.alpha.x[0])
ax.xaxis.set_major_formatter(FuncFormatter(x_format))
yticks = np.linspace(0,1,5) * self.alpha.y.size
ax.yaxis.set_ticks(yticks)
@@ -568,9 +568,10 @@
# Add colorbar limits to the ticks (May not give ideal results)
xticks = np.append(visible[0], xticks)
xticks = np.append(visible[-1], xticks)
+
ax.yaxis.set_ticks(xticks)
def x_format(x, pos):
- val = x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size) + self.alpha.x[0]
+ val = x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size-1) + self.alpha.x[0]
if abs(val) < 1.e-3 or abs(val) > 1.e4:
e = np.floor(np.log10(abs(val)))
return r"${:.2f}\times 10^{:d}$".format(val/10.0**e, int(e))
https://bitbucket.org/yt_analysis/yt/commits/2ee40dae8c22/
Changeset: 2ee40dae8c22
Branch: yt-3.0
User: mzingale
Date: 2014-05-23 19:26:50
Summary: merge
Affected #: 2 files
diff -r d3dedb7b3414602fea4e4d592b8312b1a8c456bd -r 2ee40dae8c2238dcaf8c248c95fac7ee262834a9 yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -1029,9 +1029,9 @@
def get_binary_op_return_class(cls1, cls2):
if cls1 is cls2:
return cls1
- if cls1 is np.ndarray or issubclass(cls1, numeric_type):
+ if cls1 is np.ndarray or issubclass(cls1, (numeric_type, np.number)):
return cls2
- if cls2 is np.ndarray or issubclass(cls2, numeric_type):
+ if cls2 is np.ndarray or issubclass(cls2, (numeric_type, np.number)):
return cls1
if issubclass(cls1, YTQuantity):
return cls2
diff -r d3dedb7b3414602fea4e4d592b8312b1a8c456bd -r 2ee40dae8c2238dcaf8c248c95fac7ee262834a9 yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -852,6 +852,7 @@
self.profile.set_y_unit(unit)
elif field in fields:
self.profile.set_field_unit(field, unit)
+ self.plots[field].zmin, self.plots[field].zmax = (None, None)
else:
raise KeyError("Field %s not in phase plot!" % (field))
return self
https://bitbucket.org/yt_analysis/yt/commits/7ed3ddfe5e40/
Changeset: 7ed3ddfe5e40
Branch: yt-3.0
User: mzingale
Date: 2014-05-23 19:43:46
Summary: we are double plotting some tick values in vert_cbar() making them look bold.
Affected #: 1 file
diff -r 2ee40dae8c2238dcaf8c248c95fac7ee262834a9 -r 7ed3ddfe5e40c2c8202292a64c08b45d7ae22151 yt/visualization/volume_rendering/transfer_functions.py
--- a/yt/visualization/volume_rendering/transfer_functions.py
+++ b/yt/visualization/volume_rendering/transfer_functions.py
@@ -568,7 +568,8 @@
# Add colorbar limits to the ticks (May not give ideal results)
xticks = np.append(visible[0], xticks)
xticks = np.append(visible[-1], xticks)
-
+ # remove dupes
+ xticks = list(set(xticks))
ax.yaxis.set_ticks(xticks)
def x_format(x, pos):
val = x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size-1) + self.alpha.x[0]
https://bitbucket.org/yt_analysis/yt/commits/91a14a8d910d/
Changeset: 91a14a8d910d
Branch: yt-3.0
User: mzingale
Date: 2014-05-23 20:04:50
Summary: fix my tick fix -- now all the ticks seem right
Affected #: 1 file
diff -r 7ed3ddfe5e40c2c8202292a64c08b45d7ae22151 -r 91a14a8d910d993e32d51b06849453a3d3306174 yt/visualization/volume_rendering/transfer_functions.py
--- a/yt/visualization/volume_rendering/transfer_functions.py
+++ b/yt/visualization/volume_rendering/transfer_functions.py
@@ -466,7 +466,7 @@
ax.fill_between(np.arange(self.alpha.y.size), self.alpha.x.size * self.alpha.y, y2=self.alpha.x.size, color='white')
ax.set_xlim(0, self.alpha.x.size)
xticks = np.arange(np.ceil(self.alpha.x[0]), np.floor(self.alpha.x[-1]) + 1, 1) - self.alpha.x[0]
- xticks *= self.alpha.x.size / (self.alpha.x[-1] - self.alpha.x[0])
+ xticks *= (self.alpha.x.size-1) / (self.alpha.x[-1] - self.alpha.x[0])
ax.xaxis.set_ticks(xticks)
def x_format(x, pos):
return "%.1f" % (x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size-1) + self.alpha.x[0])
@@ -507,7 +507,7 @@
ax.fill_between(np.arange(self.alpha.y.size), self.alpha.x.size * self.alpha.y, y2=self.alpha.x.size, color='white')
ax.set_xlim(0, self.alpha.x.size)
xticks = np.arange(np.ceil(self.alpha.x[0]), np.floor(self.alpha.x[-1]) + 1, 1) - self.alpha.x[0]
- xticks *= self.alpha.x.size / (self.alpha.x[-1] - self.alpha.x[0])
+ xticks *= (self.alpha.x.size-1) / (self.alpha.x[-1] - self.alpha.x[0])
if len(xticks) > 5:
xticks = xticks[::len(xticks)/5]
ax.xaxis.set_ticks(xticks)
@@ -561,7 +561,7 @@
# Display colobar values
xticks = np.arange(np.ceil(self.alpha.x[0]), np.floor(self.alpha.x[-1]) + 1, 1) - self.alpha.x[0]
- xticks *= self.alpha.x.size / (self.alpha.x[-1] - self.alpha.x[0])
+ xticks *= (self.alpha.x.size-1) / (self.alpha.x[-1] - self.alpha.x[0])
if len(xticks) > 5:
xticks = xticks[::len(xticks)/5]
https://bitbucket.org/yt_analysis/yt/commits/3c7983a318d5/
Changeset: 3c7983a318d5
Branch: yt-3.0
User: ngoldbaum
Date: 2014-05-24 23:31:18
Summary: Merged in mzingale/yt/yt-3.0 (pull request #922)
fix transfer function tick labels
Affected #: 1 file
diff -r 4702092b7f7dd94137bc5efda428a62eb0532f04 -r 3c7983a318d58fcd39b65eaf24198a3d03e0cb19 yt/visualization/volume_rendering/transfer_functions.py
--- a/yt/visualization/volume_rendering/transfer_functions.py
+++ b/yt/visualization/volume_rendering/transfer_functions.py
@@ -466,10 +466,10 @@
ax.fill_between(np.arange(self.alpha.y.size), self.alpha.x.size * self.alpha.y, y2=self.alpha.x.size, color='white')
ax.set_xlim(0, self.alpha.x.size)
xticks = np.arange(np.ceil(self.alpha.x[0]), np.floor(self.alpha.x[-1]) + 1, 1) - self.alpha.x[0]
- xticks *= self.alpha.x.size / (self.alpha.x[-1] - self.alpha.x[0])
+ xticks *= (self.alpha.x.size-1) / (self.alpha.x[-1] - self.alpha.x[0])
ax.xaxis.set_ticks(xticks)
def x_format(x, pos):
- return "%.1f" % (x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size) + self.alpha.x[0])
+ return "%.1f" % (x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size-1) + self.alpha.x[0])
ax.xaxis.set_major_formatter(FuncFormatter(x_format))
yticks = np.linspace(0,1,5) * self.alpha.y.size
ax.yaxis.set_ticks(yticks)
@@ -507,12 +507,12 @@
ax.fill_between(np.arange(self.alpha.y.size), self.alpha.x.size * self.alpha.y, y2=self.alpha.x.size, color='white')
ax.set_xlim(0, self.alpha.x.size)
xticks = np.arange(np.ceil(self.alpha.x[0]), np.floor(self.alpha.x[-1]) + 1, 1) - self.alpha.x[0]
- xticks *= self.alpha.x.size / (self.alpha.x[-1] - self.alpha.x[0])
+ xticks *= (self.alpha.x.size-1) / (self.alpha.x[-1] - self.alpha.x[0])
if len(xticks) > 5:
xticks = xticks[::len(xticks)/5]
ax.xaxis.set_ticks(xticks)
def x_format(x, pos):
- return "%.1f" % (x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size) + self.alpha.x[0])
+ return "%.1f" % (x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size-1) + self.alpha.x[0])
ax.xaxis.set_major_formatter(FuncFormatter(x_format))
yticks = np.linspace(0,1,5) * self.alpha.y.size
ax.yaxis.set_ticks(yticks)
@@ -561,16 +561,18 @@
# Display colobar values
xticks = np.arange(np.ceil(self.alpha.x[0]), np.floor(self.alpha.x[-1]) + 1, 1) - self.alpha.x[0]
- xticks *= self.alpha.x.size / (self.alpha.x[-1] - self.alpha.x[0])
+ xticks *= (self.alpha.x.size-1) / (self.alpha.x[-1] - self.alpha.x[0])
if len(xticks) > 5:
xticks = xticks[::len(xticks)/5]
# Add colorbar limits to the ticks (May not give ideal results)
xticks = np.append(visible[0], xticks)
xticks = np.append(visible[-1], xticks)
+ # remove dupes
+ xticks = list(set(xticks))
ax.yaxis.set_ticks(xticks)
def x_format(x, pos):
- val = x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size) + self.alpha.x[0]
+ val = x * (self.alpha.x[-1] - self.alpha.x[0]) / (self.alpha.x.size-1) + self.alpha.x[0]
if abs(val) < 1.e-3 or abs(val) > 1.e4:
e = np.floor(np.log10(abs(val)))
return r"${:.2f}\times 10^{:d}$".format(val/10.0**e, int(e))
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