예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
파일: utils.py 프로젝트: MikeVolk/RockPy3
 def test_to_list(self):
     a = 'test'
     self.assertEqual(['test'], to_list(a))