[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Feb 9 06:52:21 PST 2017
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/8f2462f04f96/
Changeset: 8f2462f04f96
Branch: yt
User: ngoldbaum
Date: 2017-02-07 17:00:42+00:00
Summary: Use contiguous arrays for deposit fields. Fixes #1319
Affected #: 1 file
diff -r 13c1ee22f924f988c6dfc68c9b64d6e9acdebfd2 -r 8f2462f04f969bef42a18ccb3c75b6d817976b09 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -1249,16 +1249,15 @@
Create a grid field for particle quantities using given method.
"""
pos = data[ptype, "particle_position"]
+ fields = [data[ptype, deposit_field]]
if method == 'weighted_mean':
- d = data.ds.arr(data.deposit(pos, [data[ptype, deposit_field],
- data[ptype, weight_field]],
- method=method, kernel_name=kernel_name),
- input_units=units)
+ fields.append(data[ptype, weight_field])
+ fields = [np.ascontiguousarray(f) for f in fields]
+ d = data.deposit(pos, fields, method=method,
+ kernel_name=kernel_name)
+ d = data.ds.arr(d, input_units=units)
+ if method == 'weighted_mean':
d[np.isnan(d)] = 0.0
- else:
- d = data.ds.arr(data.deposit(pos, [data[ptype, deposit_field]],
- method=method, kernel_name=kernel_name),
- input_units=units)
return d
self.add_field(
https://bitbucket.org/yt_analysis/yt/commits/fb62830c163d/
Changeset: fb62830c163d
Branch: yt
User: xarthisius
Date: 2017-02-09 14:52:10+00:00
Summary: Merged in ngoldbaum/yt (pull request #2518)
Use contiguous arrays for deposit fields. Fixes #1319
Approved-by: Desika Narayanan
Approved-by: John ZuHone
Approved-by: Kacper Kowalik
Affected #: 1 file
diff -r 441ff5e2dcd342526152309d260e912300fdcd3b -r fb62830c163dff615a41314214a81e4e784155b1 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -1249,16 +1249,15 @@
Create a grid field for particle quantities using given method.
"""
pos = data[ptype, "particle_position"]
+ fields = [data[ptype, deposit_field]]
if method == 'weighted_mean':
- d = data.ds.arr(data.deposit(pos, [data[ptype, deposit_field],
- data[ptype, weight_field]],
- method=method, kernel_name=kernel_name),
- input_units=units)
+ fields.append(data[ptype, weight_field])
+ fields = [np.ascontiguousarray(f) for f in fields]
+ d = data.deposit(pos, fields, method=method,
+ kernel_name=kernel_name)
+ d = data.ds.arr(d, input_units=units)
+ if method == 'weighted_mean':
d[np.isnan(d)] = 0.0
- else:
- d = data.ds.arr(data.deposit(pos, [data[ptype, deposit_field]],
- method=method, kernel_name=kernel_name),
- input_units=units)
return d
self.add_field(
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