From 64675d43272625464ef49e657dd9f61d8459e074 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 16 Sep 2020 14:09:46 -0500 Subject: 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 --- wqflask/wqflask/show_trait/SampleList.py | 6 +----- 1 file changed, 1 insertion(+), 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""" -- cgit v1.2.3