[yt-svn] commit/yt: mzingale: make clump-finding work for non-cosmological data by checking if

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Nov 21 12:44:16 PST 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/5bd8229b55cf/
Changeset:   5bd8229b55cf
Branch:      yt
User:        mzingale
Date:        2014-11-21 20:25:33+00:00
Summary:     make clump-finding work for non-cosmological data by checking if
the jeans_mass or number_density fields exist when adding them
to the clump info.
Affected #:  1 file

diff -r 1d80f22363021f6662f0555c545a9ef4272c483d -r 5bd8229b55cfe72386fdfd1eb8e00c80f9e6f3b3 yt/analysis_modules/level_sets/clump_handling.py
--- a/yt/analysis_modules/level_sets/clump_handling.py
+++ b/yt/analysis_modules/level_sets/clump_handling.py
@@ -98,11 +98,16 @@
 
         self.add_info_item("total_cells")
         self.add_info_item("cell_mass")
-        self.add_info_item("mass_weighted_jeans_mass")
-        self.add_info_item("volume_weighted_jeans_mass")
+
+        if any("jeans" in f for f in self.data.pf.field_list):
+            self.add_info_item("mass_weighted_jeans_mass")
+            self.add_info_item("volume_weighted_jeans_mass")
+
         self.add_info_item("max_grid_level")
-        self.add_info_item("min_number_density")
-        self.add_info_item("max_number_density")
+
+        if any("number_density" in f for f in self.data.pf.field_list):
+            self.add_info_item("min_number_density")
+            self.add_info_item("max_number_density")
 
     def clear_clump_info(self):
         """

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