Beispiel #1
0
 def test_loadFile_exampleValues(self):
     # check the length
     pdDF = io.loadFile(
         'examples/valid/' +
         'example_Metatranscriptome_9_HOW4_[LakWasMeta9_HOW4_2]/IMG_Data/' +
         '61177.assembled.faa.phylodist',
         verbose=True
     )
     self.assertEquals(len(pdDF.index), 10001)
     # spot check row 98's locus_tag
     self.assertEquals(pdDF.at[97, 'locus_tag'], 'Ga0066495_1324111')
Beispiel #2
0
 def test_loadFile_exampleValues(self):
     # check the length
     pdDF = io.loadFile(
         'examples/valid/' +
         'example_Metatranscriptome_9_HOW4_[LakWasMeta9_HOW4_2]/IMG_Data/' +
         '61177.assembled.faa.phylodist',
         verbose=True
     )
     self.assertEquals(len(pdDF.index), 10001)
     # spot check row 98's locus_tag
     self.assertEquals(pdDF.at[97, 'locus_tag'], 'Ga0066495_1324111')
Beispiel #3
0
 def test_loadFile_filenameType(self):
     with self.assertRaises(TypeError):
         io.loadFile(42)
Beispiel #4
0
 def test_loadFile_incorrectTaxFieldCount(self):
     with self.assertRaises(ValueError):
         io.loadFile('examples/invalid/badTaxRecordLength.phylodist')
Beispiel #5
0
 def test_loadFile_directoryNotFile(self):
     with self.assertRaises(IOError):
         io.loadFile('examples')
Beispiel #6
0
 def test_loadFile_nonExistentFile(self):
     with self.assertRaises(IOError):
         io.loadFile('file_does_not_exist')
Beispiel #7
0
 def test_loadFile_verboseType(self):
     with self.assertRaises(TypeError):
         io.loadFile('filename', 42)
Beispiel #8
0
fpsClock = pygame.time.Clock()
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption('tsar-bomba - Model Maker')
pygame.mouse.set_visible(1)

running = True
playAnim = False
speed = 0
colors = colset.colorList()
currentColor = (255,0,0)
colorHistory = []
frameIndex = 0
speedTicks = [1,3,6,10,30]

filename, model = io.loadFile(sys.argv)
speed = model.speed

print "Using: %s" % filename

gui = GUI(screen) # all static parts of the GUI is drawn
gui.drawColor(currentColor)
gui.drawFrame(model.frame(frameIndex).grid)

while running:
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
        
        if event.type == MOUSEBUTTONDOWN:
Beispiel #9
0
 def test_loadFile_nonExistentFile(self):
     with self.assertRaises(IOError):
         io.loadFile('file_does_not_exist')
Beispiel #10
0
 def test_loadFile_verboseType(self):
     with self.assertRaises(TypeError):
         io.loadFile('filename', 42)
Beispiel #11
0
 def test_loadFile_filenameType(self):
     with self.assertRaises(TypeError):
         io.loadFile(42)
Beispiel #12
0
 def test_loadFile_incorrectTaxFieldCount(self):
     with self.assertRaises(ValueError):
         io.loadFile('examples/invalid/badTaxRecordLength.phylodist')
Beispiel #13
0
 def test_loadFile_directoryNotFile(self):
     with self.assertRaises(IOError):
         io.loadFile('examples')