[yt-svn] commit/yt: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Nov 23 11:16:30 PST 2015


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/abfca9074722/
Changeset:   abfca9074722
Branch:      yt
User:        MatthewTurk
Date:        2015-11-22 22:29:08+00:00
Summary:     Update TransferFunctionHelper to work with create_profiles, etc.
Affected #:  1 file

diff -r 27f664fe46a4ec9361421167ffb7f963428ac912 -r abfca9074722e6748b21f29a54589e5fea22e6c4 yt/visualization/volume_rendering/transfer_function_helper.py
--- a/yt/visualization/volume_rendering/transfer_function_helper.py
+++ b/yt/visualization/volume_rendering/transfer_function_helper.py
@@ -190,11 +190,12 @@
             except KeyError:
                 self.setup_profile(profile_field, profile_weight)
                 prof = self.profiles[self.field]
-            if profile_field not in prof.keys():
-                prof.add_fields([profile_field], fractional=False,
-                                weight=profile_weight)
+            try:
+                prof[profile_field]
+            except KeyError:
+                prof.add_fields([profile_field])
             # Strip units, if any, for matplotlib 1.3.1
-            xplot = np.array(prof[self.field])
+            xplot = np.array(prof.x)
             yplot = np.array(prof[profile_field]*tf.funcs[3].y.max() /
                              prof[profile_field].max())
             ax.plot(xplot, yplot, color='w', linewidth=3)
@@ -220,10 +221,8 @@
         if profile_field is None:
             profile_field = 'cell_volume'
         prof = create_profile(self.ds.all_data(), self.field, profile_field,
-                              n_bins=128, extrema={profile_field: self.bounds},
+                              n_bins=128, extrema={self.field: self.bounds},
                               weight_field=profile_weight,
-                              log_space=self.log)
-        prof.add_fields([profile_field], fractional=False,
-                        weight=profile_weight)
+                              logs = {self.field: self.log})
         self.profiles[self.field] = prof
         return


https://bitbucket.org/yt_analysis/yt/commits/2aee7c831d41/
Changeset:   2aee7c831d41
Branch:      yt
User:        bwkeller
Date:        2015-11-23 19:16:24+00:00
Summary:     Merged in MatthewTurk/yt (pull request #1881)

Update TFH to work with new profiles
Affected #:  1 file

diff -r b949b80ab0941331195e1653ce85e836909f20a9 -r 2aee7c831d41161f3f9420a676df3f4926994a4f yt/visualization/volume_rendering/transfer_function_helper.py
--- a/yt/visualization/volume_rendering/transfer_function_helper.py
+++ b/yt/visualization/volume_rendering/transfer_function_helper.py
@@ -190,11 +190,12 @@
             except KeyError:
                 self.setup_profile(profile_field, profile_weight)
                 prof = self.profiles[self.field]
-            if profile_field not in prof.keys():
-                prof.add_fields([profile_field], fractional=False,
-                                weight=profile_weight)
+            try:
+                prof[profile_field]
+            except KeyError:
+                prof.add_fields([profile_field])
             # Strip units, if any, for matplotlib 1.3.1
-            xplot = np.array(prof[self.field])
+            xplot = np.array(prof.x)
             yplot = np.array(prof[profile_field]*tf.funcs[3].y.max() /
                              prof[profile_field].max())
             ax.plot(xplot, yplot, color='w', linewidth=3)
@@ -220,10 +221,8 @@
         if profile_field is None:
             profile_field = 'cell_volume'
         prof = create_profile(self.ds.all_data(), self.field, profile_field,
-                              n_bins=128, extrema={profile_field: self.bounds},
+                              n_bins=128, extrema={self.field: self.bounds},
                               weight_field=profile_weight,
-                              log_space=self.log)
-        prof.add_fields([profile_field], fractional=False,
-                        weight=profile_weight)
+                              logs = {self.field: self.log})
         self.profiles[self.field] = prof
         return

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