[yt-svn] commit/yt: 8 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri Jan 12 08:18:16 PST 2018
8 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/6018026f320b/
Changeset: 6018026f320b
User: maxpkatz
Date: 2018-01-11 06:52:43+00:00
Summary: Fix the name of the colors keyword to matplotlib contour
The annotate_contour callback passes 'color' as a keyword to contour
from matplotlib, but this is not a known keyword. This appears to be
a typo in commit 9a2f4ff4a5; prior to then, the correct keyword (colors)
was passed to the contour plot. This commit will have the effect of
making all contours be black in color by default.
Affected #: 1 file
diff -r 057252ced4639a8a5decd07e2a6850c0366f5db2 -r 6018026f320b4878c038d3480332ce0019f5791d yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -466,7 +466,7 @@
plot_args=None, label=False, take_log=None,
label_args=None, text_args=None, data_source=None):
PlotCallback.__init__(self)
- def_plot_args = {'color':'k'}
+ def_plot_args = {'colors':'k'}
def_text_args = {'color':'w'}
self.ncont = ncont
self.field = field
https://bitbucket.org/yt_analysis/yt/commits/4bd59de853ca/
Changeset: 4bd59de853ca
User: ngoldbaum
Date: 2018-01-11 15:45:32+00:00
Summary: Merge pull request #1664 from maxpkatz/contour_colors
Fix the name of the colors keyword to matplotlib contour
Affected #: 1 file
diff -r 057252ced4639a8a5decd07e2a6850c0366f5db2 -r 4bd59de853ca078c6542dad2616315ba581c30e1 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -466,7 +466,7 @@
plot_args=None, label=False, take_log=None,
label_args=None, text_args=None, data_source=None):
PlotCallback.__init__(self)
- def_plot_args = {'color':'k'}
+ def_plot_args = {'colors':'k'}
def_text_args = {'color':'w'}
self.ncont = ncont
self.field = field
https://bitbucket.org/yt_analysis/yt/commits/83a6949daa92/
Changeset: 83a6949daa92
User: atmyers
Date: 2018-01-04 23:38:10+00:00
Summary: fix a bug in initializing the species charge / mass in the warpx frontend.
Affected #: 1 file
diff -r 4bdb4891377cc76dc4aa4ada826f0fc47b9ea4f9 -r 83a6949daa922490a774d523a12a19cc5f9598b0 yt/frontends/boxlib/data_structures.py
--- a/yt/frontends/boxlib/data_structures.py
+++ b/yt/frontends/boxlib/data_structures.py
@@ -1461,14 +1461,13 @@
# Additional WarpX particle information (used to set up species)
self.warpx_header = WarpXHeader(self.ds.output_dir + "/WarpXHeader")
- i = 0
for key, val in self.warpx_header.data.items():
if key.startswith("species_"):
+ i = int(key.split("_")[-1])
charge_name = 'particle%.1d_charge' % i
mass_name = 'particle%.1d_mass' % i
self.parameters[charge_name] = val[0]
self.parameters[mass_name] = val[1]
- i = i + 1
def _detect_output_fields(self):
super(WarpXHierarchy, self)._detect_output_fields()
https://bitbucket.org/yt_analysis/yt/commits/c74773c4055a/
Changeset: c74773c4055a
User: ngoldbaum
Date: 2018-01-11 15:56:37+00:00
Summary: Merge pull request #1658 from atmyers/warpx_species_bugfix
[BUGFIX] Fix a bug in initializing the species charge / mass in the WarpX frontend.
Affected #: 1 file
diff -r 4bd59de853ca078c6542dad2616315ba581c30e1 -r c74773c4055a498470401f3f5626d16f8ebe506a yt/frontends/boxlib/data_structures.py
--- a/yt/frontends/boxlib/data_structures.py
+++ b/yt/frontends/boxlib/data_structures.py
@@ -1461,14 +1461,13 @@
# Additional WarpX particle information (used to set up species)
self.warpx_header = WarpXHeader(self.ds.output_dir + "/WarpXHeader")
- i = 0
for key, val in self.warpx_header.data.items():
if key.startswith("species_"):
+ i = int(key.split("_")[-1])
charge_name = 'particle%.1d_charge' % i
mass_name = 'particle%.1d_mass' % i
self.parameters[charge_name] = val[0]
self.parameters[mass_name] = val[1]
- i = i + 1
def _detect_output_fields(self):
super(WarpXHierarchy, self)._detect_output_fields()
https://bitbucket.org/yt_analysis/yt/commits/07c27631dcdd/
Changeset: 07c27631dcdd
User: ngoldbaum
Date: 2018-01-10 17:24:28+00:00
Summary: add a special case for array scalars in YTArray.__str__
Affected #: 1 file
diff -r 057252ced4639a8a5decd07e2a6850c0366f5db2 -r 07c27631dcdda772dbce7387ae5af4c401c70fbf yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -529,7 +529,11 @@
"""
"""
- return super(YTArray, self).__str__()+' '+self.units.__str__()
+ # need to check if we're dealing with a scalar to avoid a recursion
+ # error on NumPy 1.14 and newer
+ if self.shape != ():
+ return super(YTArray, self).__str__()+' '+self.units.__str__()
+ return str(np.asarray(self)) + ' ' + str(self.units)
#
# Start unit conversion methods
https://bitbucket.org/yt_analysis/yt/commits/6e5bf8f9d92d/
Changeset: 6e5bf8f9d92d
User: ngoldbaum
Date: 2018-01-10 18:48:24+00:00
Summary: fix failing ufunc test
Affected #: 1 file
diff -r 07c27631dcdda772dbce7387ae5af4c401c70fbf -r 6e5bf8f9d92dec10da53fb23d85170986385b506 yt/units/tests/test_ytarray.py
--- a/yt/units/tests/test_ytarray.py
+++ b/yt/units/tests/test_ytarray.py
@@ -815,7 +815,8 @@
elif ufunc is np.invert:
assert_raises(TypeError, ufunc, a)
elif hasattr(np, 'isnat') and ufunc is np.isnat:
- assert_raises(ValueError, ufunc, a)
+ # numpy 1.13 raises ValueError, numpy 1.14 and newer raise TypeError
+ assert_raises((TypeError, ValueError), ufunc, a)
else:
# There shouldn't be any untested ufuncs.
assert_true(False)
https://bitbucket.org/yt_analysis/yt/commits/a8f2e07a07d6/
Changeset: a8f2e07a07d6
User: ngoldbaum
Date: 2018-01-10 21:07:30+00:00
Summary: avoid if statement
Affected #: 1 file
diff -r 6e5bf8f9d92dec10da53fb23d85170986385b506 -r a8f2e07a07d625357222fb5a2aa209278d35460b yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -529,11 +529,7 @@
"""
"""
- # need to check if we're dealing with a scalar to avoid a recursion
- # error on NumPy 1.14 and newer
- if self.shape != ():
- return super(YTArray, self).__str__()+' '+self.units.__str__()
- return str(np.asarray(self)) + ' ' + str(self.units)
+ return str(self.view(np.ndarray)) + ' ' + str(self.units)
#
# Start unit conversion methods
https://bitbucket.org/yt_analysis/yt/commits/bcd6d24d0a4f/
Changeset: bcd6d24d0a4f
User: ngoldbaum
Date: 2018-01-11 15:56:47+00:00
Summary: Merge pull request #1661 from ngoldbaum/array-print-fix
add a special case for array scalars in YTArray.__str__
Affected #: 2 files
diff -r c74773c4055a498470401f3f5626d16f8ebe506a -r bcd6d24d0a4fd33e60a5d3bef5d4538ca2383317 yt/units/tests/test_ytarray.py
--- a/yt/units/tests/test_ytarray.py
+++ b/yt/units/tests/test_ytarray.py
@@ -815,7 +815,8 @@
elif ufunc is np.invert:
assert_raises(TypeError, ufunc, a)
elif hasattr(np, 'isnat') and ufunc is np.isnat:
- assert_raises(ValueError, ufunc, a)
+ # numpy 1.13 raises ValueError, numpy 1.14 and newer raise TypeError
+ assert_raises((TypeError, ValueError), ufunc, a)
else:
# There shouldn't be any untested ufuncs.
assert_true(False)
diff -r c74773c4055a498470401f3f5626d16f8ebe506a -r bcd6d24d0a4fd33e60a5d3bef5d4538ca2383317 yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -529,7 +529,7 @@
"""
"""
- return super(YTArray, self).__str__()+' '+self.units.__str__()
+ return str(self.view(np.ndarray)) + ' ' + str(self.units)
#
# Start unit conversion methods
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