예제 #1
0
파일: route.py 프로젝트: hervold/96wells
def create():

    config = get_test_config()
    initdb(config['DB']['engine'])

    fixtures.load()

    conn = get_handle()
    xaction = Xaction()
    conn.add(xaction)
    conn.commit()
    typ1, typC = SampleType(name='patient'), SampleType(name='control')
    s1, s2 = Sample(sample_type=typ1), Sample(sample_type=typC)
    plate96_t = conn.query(ContainerType).filter(ContainerType.name=='Plate-96_well').one()
    plate = ContainerInst( name='my_plate', type=plate96_t )
    conn.add(plate)
    conn.commit()

    well1 = conn.query(Container).filter(Container.type == plate96_t).filter(Container.name == 'A01').one()
    well2 = conn.query(Container).filter(Container.type == plate96_t).filter(Container.name == 'A02').one()
    p1 = Plating( plate=plate, well=well1, sample=s1, xaction=xaction )
    p2 = Plating( plate=plate, well=well2, sample=s2, xaction=xaction )
    conn.add( p1 )
    conn.add( p2 )
    conn.commit()
    return plate
예제 #2
0
파일: test.py 프로젝트: hervold/96wells
    def test_cont(self):
        fixtures.load()

        conn = get_handle()
        for typ in conn.query(ContainerTyp):
            for cont in typ.units:
                print('@@ %s :: %s' % (typ, cont))
예제 #3
0
파일: helper.py 프로젝트: hervold/96wells
def main():
    print('@@ helper main')
    config = get_config()
    destroydb(config['DB']['engine'])
    initdb(config['DB']['engine'])
    DB << fixtures.load()
    DB << populate_plate()