def get_sample(self, gname=None, sname=None, mtype=None, series=None, stype=None, sval=None, sval_range=None, mean=False, invert=False, ): slist = self.samplelist if not any(i for i in [gname, sname, mtype, series, stype, sval, sval_range, mean, invert]): return slist # samplegroup filtering if gname: gname = utils.to_list(gname) slist = [s for s in slist if any(sg in gname for sg in s._samplegroups)] # sample filtering if sname: sname = utils.to_list(sname) slist = [s for s in slist if s.name in sname] if any(i for i in [mtype, series, stype, sval, sval_range, mean, invert]): slist = [s for s in slist if s.get_measurement(mtype=mtype, stype=stype, sval=sval, sval_range=sval_range, series=series, mean=mean, invert=invert)] return slist
def get_sample( self, gname=None, sname=None, mtype=None, series=None, stype=None, sval=None, sval_range=None, mean=False, invert=False, ): slist = self.samplelist if not any(i for i in [ gname, sname, mtype, series, stype, sval, sval_range, mean, invert ]): return slist # samplegroup filtering if gname: gname = utils.to_list(gname) slist = [ s for s in slist if any(sg in gname for sg in s._samplegroups) ] # sample filtering if sname: sname = utils.to_list(sname) slist = [s for s in slist if s.name in sname] if any(i for i in [mtype, series, stype, sval, sval_range, mean, invert]): slist = [ s for s in slist if s.get_measurement(mtype=mtype, stype=stype, sval=sval, sval_range=sval_range, series=series, mean=mean, invert=invert) ] return slist
def test_to_list(self): a = 'test' self.assertEqual(['test'], to_list(a))