def testtable(self):
     tab1=Table()
     tab2=Table()
     tab1.read('testfiles/tab1.txt',columnames=True)
     tab2.read('testfiles/tab1.txt',columnames=False)
     print ('read test')
     print (tab1)
     print (tab2)
     tab1.read('testfiles/tab1.txt',columnames=True)
     tab2.read('testfiles/tab2.txt',columnames=True)
     print ('merge test')
     print (tab1)
     print (tab2)
     tab1.merge(tab2,by_x='r',by_y='w')
     print (tab1)
     tab2.read('testfiles/tab2.txt',columnames=True)
     tab2.write_html('testfiles/tab2.html')
     tab2.write('testfiles/tab2-repo.txt')
     sub1 = tab1.getcolumn(('r','t')).tolist()
     self.assertEqual(sub1,[['3', '3'],['3', '333']])
     sub2 = tab1.getcolumn(0).tolist()
     self.assertEqual(sub2,[['1'],['2']])
示例#2
0
 def testtable(self):
     tab1 = Table()
     tab2 = Table()
     tab1.read('testfiles/tab1.txt', columnames=True)
     tab2.read('testfiles/tab1.txt', columnames=False)
     print('read test')
     print(tab1)
     print(tab2)
     tab1.read('testfiles/tab1.txt', columnames=True)
     tab2.read('testfiles/tab2.txt', columnames=True)
     print('merge test')
     print(tab1)
     print(tab2)
     tab1.merge(tab2, by_x='r', by_y='w')
     print(tab1)
     tab2.read('testfiles/tab2.txt', columnames=True)
     tab2.write_html('testfiles/tab2.html')
     tab2.write('testfiles/tab2-repo.txt')
     sub1 = tab1.getcolumn(('r', 't')).tolist()
     self.assertEqual(sub1, [['3', '3'], ['3', '333']])
     sub2 = tab1.getcolumn(0).tolist()
     self.assertEqual(sub2, [['1'], ['2']])
示例#3
0
def testrun():
    rp = 6
    lp = 9

    data = [range(0 + i, 3 + i) for i in range(1, 25)]
    data = [
        tuple(ele[0:2] + [rp, 2, 'k']) if ele[2] < 10 else tuple(ele[0:2] +
                                                                 [lp, 6, 'o'])
        for ele in data
    ]
    tab = Table('testdata')
    tab.data = data
    tab.columnames = ('A', 'B', 'C', 'D', 'E')
    tab.write('testplotdata.txt')

    statoverview(tab)
    # figure=matplotlib.pyplot.figure('ooop')
    # matplotlib.pyplot.show()
    # matplotlib.pyplot.close('all')
    # matplotlib.pyplot.close(figure)

    ggscatterplot(tabdata=tab,
                  xvar='A',
                  yvar='B',
                  group='',
                  error='',
                  figname='a.pdf',
                  main='a',
                  colormode='hue',
                  graphncol=0,
                  width=7,
                  height=7,
                  gformat='pdf',
                  doscale=False,
                  dolabelflip=False,
                  reducepnt=False,
                  dofit=False)

    ggscatterplot(tabdata=tab,
                  xvar='A',
                  yvar='B',
                  group='C',
                  error='',
                  figname='b.pdf',
                  main='b',
                  colormode='hue',
                  graphncol=0,
                  width=7,
                  height=7,
                  gformat='pdf',
                  doscale=False,
                  dolabelflip=False,
                  reducepnt=False,
                  dofit=False)

    ggscatterplot(tabdata=tab,
                  xvar='A',
                  yvar='B',
                  group='C',
                  error='D',
                  figname='c.pdf',
                  main='c',
                  colormode='hue',
                  graphncol=0,
                  width=7,
                  height=7,
                  gformat='pdf',
                  doscale=False,
                  dolabelflip=False,
                  reducepnt=False,
                  dofit=False)

    ggscatterplot(tabdata=tab,
                  xvar='A',
                  yvar='B',
                  group='C',
                  error='',
                  figname='d.pdf',
                  main='d',
                  colormode='hue',
                  graphncol=0,
                  width=7,
                  height=7,
                  gformat='pdf',
                  doscale=False,
                  dolabelflip=False,
                  reducepnt=False,
                  dofit=False)

    ggboxplot(tabdata=tab,
              xvar='E',
              yvar='B',
              group='C',
              error='',
              figname='e.pdf',
              main='e',
              colormode='hue',
              graphncol=0,
              width=7,
              height=7,
              gformat='pdf',
              doscale=False,
              dolabelflip=False)

    ggbarplot(tabdata=tab,
              xvar='A',
              yvar='B',
              group='A',
              error='',
              figname='f.pdf',
              main='ABA',
              colormode='hue',
              graphncol=0,
              width=7,
              height=7,
              gformat='pdf',
              doscale=False,
              dolabelflip=False)

    ggbarplot(tabdata=tab,
              xvar='A',
              yvar='B',
              group='E',
              error='',
              figname='g.pdf',
              main='ABE',
              colormode='hue',
              graphncol=0,
              width=7,
              height=7,
              gformat='pdf',
              doscale=False,
              dolabelflip=False)

    ggbarplot(tabdata=tab,
              xvar='A',
              yvar='B',
              group='',
              error='',
              figname='h.pdf',
              main='AB',
              colormode='hue',
              graphncol=0,
              width=7,
              height=7,
              gformat='pdf',
              doscale=False,
              dolabelflip=False)