about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzsloan2020-09-16 14:09:46 -0500
committerzsloan2020-09-16 14:09:46 -0500
commit64675d43272625464ef49e657dd9f61d8459e074 (patch)
tree97646e9512c4127b3907edcf5922f6b094e2ad3f
parent07959c86e235072eaa46974ada5ea9c0432f49e7 (diff)
downloadgenenetwork2-64675d43272625464ef49e657dd9f61d8459e074.tar.gz
Changed se_exists to a property so the SampleList instance can include
that when converted to a dict (which is needed to use it in the
javascript)

* wqflask/wqflask/show_trait/SampleList.py - Directly set se_exists as a
property of SampleList instead of requiring a method be called; I could
have set self.se_exists by calling the se_exists method, but that would
have resulted in the convoluted line "self.se_exists = self.se_exists()"
and the se_exists method only consisted of one line anyways
-rw-r--r--wqflask/wqflask/show_trait/SampleList.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/wqflask/wqflask/show_trait/SampleList.py b/wqflask/wqflask/show_trait/SampleList.py
index 10157558..9e5be0e8 100644
--- a/wqflask/wqflask/show_trait/SampleList.py
+++ b/wqflask/wqflask/show_trait/SampleList.py
@@ -67,6 +67,7 @@ class SampleList(object):
 
             self.sample_list.append(sample)
 
+        self.se_exists = any(sample.variance for sample in self.sample_list)
         self.do_outliers()
 
     def __repr__(self):
@@ -146,11 +147,6 @@ class SampleList(object):
                     attribute_values[self.attributes[item.Id].name] = attribute_value
                 self.sample_attribute_values[sample_name] = attribute_values
 
-    def se_exists(self):
-        """Returns true if SE values exist for any samples, otherwise false"""
-
-        return any(sample.variance for sample in self.sample_list)
-
 def natural_sort_key(x):
     """Get expected results when using as a key for sort - ints or strings are sorted properly"""