[yt-svn] commit/yt: 4 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Nov 29 19:40:58 PST 2016
4 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/1ef66f1771c7/
Changeset: 1ef66f1771c7
Branch: yt
User: ngoldbaum
Date: 2016-11-29 18:07:17+00:00
Summary: Add support for the 'spacing' ufunc to YTArray
Affected #: 2 files
diff -r 0bfebdb21e22a03f91a11dff8d455ee17e885e92 -r 1ef66f1771c770073c271dd151b490eb107b9e1c yt/units/tests/test_ytarray.py
--- a/yt/units/tests/test_ytarray.py
+++ b/yt/units/tests/test_ytarray.py
@@ -719,7 +719,7 @@
assert_true(hasattr(out, 'units'))
assert_true(not hasattr(ret, 'units'))
elif ufunc in (np.absolute, np.fabs, np.conjugate, np.floor, np.ceil,
- np.trunc, np.negative):
+ np.trunc, np.negative, np.spacing):
ret = ufunc(a, out=out)
assert_array_equal(ret, out)
diff -r 0bfebdb21e22a03f91a11dff8d455ee17e885e92 -r 1ef66f1771c770073c271dd151b490eb107b9e1c yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -27,7 +27,7 @@
greater, greater_equal, less, less_equal, not_equal, equal, logical_and, \
logical_or, logical_xor, logical_not, maximum, minimum, fmax, fmin, \
isreal, iscomplex, isfinite, isinf, isnan, signbit, copysign, nextafter, \
- modf, ldexp, frexp, fmod, floor, ceil, trunc, fabs
+ modf, ldexp, frexp, fmod, floor, ceil, trunc, fabs, spacing
from yt.units.unit_object import Unit, UnitParseError
from yt.units.unit_registry import UnitRegistry
@@ -205,7 +205,7 @@
log10, expm1, log1p, sqrt, square, reciprocal, sin, cos, tan, arcsin,
arccos, arctan, sinh, cosh, tanh, arcsinh, arccosh, arctanh, deg2rad,
rad2deg, invert, logical_not, isreal, iscomplex, isfinite, isinf, isnan,
- signbit, floor, ceil, trunc, modf, frexp, fabs
+ signbit, floor, ceil, trunc, modf, frexp, fabs, spacing
)
binary_operators = (
@@ -365,6 +365,7 @@
floor: passthrough_unit,
ceil: passthrough_unit,
trunc: passthrough_unit,
+ spacing: passthrough_unit,
}
__array_priority__ = 2.0
https://bitbucket.org/yt_analysis/yt/commits/76add70190a1/
Changeset: 76add70190a1
Branch: yt
User: ngoldbaum
Date: 2016-11-29 18:16:10+00:00
Summary: Force extrema of log-scale profile bins to the specified extrema. Closes #1300.
Affected #: 1 file
diff -r 1ef66f1771c770073c271dd151b490eb107b9e1c -r 76add70190a1a2112740b250cff0eef9aee43207 yt/data_objects/profiles.py
--- a/yt/data_objects/profiles.py
+++ b/yt/data_objects/profiles.py
@@ -276,7 +276,13 @@
def _get_bins(self, mi, ma, n, take_log):
if take_log:
- return np.logspace(np.log10(mi), np.log10(ma), n+1)
+ ret = np.logspace(np.log10(mi), np.log10(ma), n+1)
+ # at this point ret[0] and ret[-1] are not exactly equal to
+ # mi and ma due to round-off error. Let's force them to be
+ # mi and ma exactly to avoid incorrectly discarding cells near
+ # the edges. See Issue #1300.
+ ret[0], ret[-1] = mi, ma
+ return ret
else:
return np.linspace(mi, ma, n+1)
https://bitbucket.org/yt_analysis/yt/commits/912593646807/
Changeset: 912593646807
Branch: yt
User: ngoldbaum
Date: 2016-11-29 18:17:26+00:00
Summary: Pad calculated profile extrema to avoid discarding cells at the extrema
Affected #: 1 file
diff -r 76add70190a1a2112740b250cff0eef9aee43207 -r 912593646807c8832a99ea475273e8a65921a41d yt/data_objects/profiles.py
--- a/yt/data_objects/profiles.py
+++ b/yt/data_objects/profiles.py
@@ -1016,6 +1016,11 @@
if extrema is None:
ex = [data_source.quantities["Extrema"](f, non_zero=l)
for f, l in zip(bin_fields, logs)]
+ # pad extrema by epsilon so cells at bin edges are not excluded
+ for i, (mi, ma) in enumerate(ex):
+ mi = mi - np.spacing(mi)
+ ma = ma + np.spacing(ma)
+ ex[i][0], ex[i][1] = mi, ma
else:
ex = []
for bin_field in bin_fields:
https://bitbucket.org/yt_analysis/yt/commits/96882803a599/
Changeset: 96882803a599
Branch: yt
User: ngoldbaum
Date: 2016-11-29 21:19:46+00:00
Summary: Increment answer numbers for tests with changed answers
Affected #: 1 file
diff -r 912593646807c8832a99ea475273e8a65921a41d -r 96882803a599e1a52ed4bb47a919970b76628efd tests/tests.yaml
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -39,7 +39,7 @@
local_owls_000:
- yt/frontends/owls/tests/test_outputs.py
- local_pw_010:
+ local_pw_011:
- yt/visualization/tests/test_plotwindow.py:test_attributes
- yt/visualization/tests/test_plotwindow.py:test_attributes_wt
- yt/visualization/tests/test_profile_plots.py:test_phase_plot_attributes
@@ -65,7 +65,7 @@
local_ramses_000:
- yt/frontends/ramses/tests/test_outputs.py
- local_ytdata_000:
+ local_ytdata_001:
- yt/frontends/ytdata
local_absorption_spectrum_005:
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