def test_make_kcfs(self): """ test for make_kcfs """ genus = "Citrus" if os.path.exists(genus): shutil.rmtree(genus) f = MCS_Finder(genus) f.make_kcfs2() kcfspath = genus + "/kcfs.kcfs" kcfscountpath = genus + "/kcfscount.txt" splitcountpath = genus + "/splitedcount.txt" self.assertTrue(os.path.exists(kcfspath)) self.assertTrue(os.path.exists(kcfscountpath)) self.assertTrue(os.path.exists(splitcountpath)) shutil.rmtree(genus)
import os import time import pickle import datetime start = time.time() with open("Brassicaceae/genuses.pickle", "rb") as fi: genlist = pickle.load(fi) try: with open("Brassicaceae/genuses.pickle", "rb") as fi: genlist2 = pickle.load(fi) for genus in genlist: if not os.path.exists("Brassicaceae"): os.mkdir("Brassicaceae") if os.path.exists("Brassicaceae/" + genus): continue f = MCS_Finder(genus, "Brassicaceae") f.make_kcfs() time.sleep(15) except: print(time.time() - start) print(datetime.datetime.now()) raise print(time.time() - start) print(datetime.datetime.now()) # In[24]: print(genlist[-21]) # In[ ]:
from classes2 import MCS_Finder import os import time import pickle import datetime start = time.time() with open(family + "/genuses.pickle", "rb") as fi: genlist = pickle.load(fi) try: for genus in genlist: if not os.path.exists(family): os.mkdir(family) if os.path.exists(family + "/" + genus): continue f = MCS_Finder(genus, family) f.make_kcfs() print(datetime.datetime.now()) print(len(os.listdir(family))) time.sleep(15) except: print(time.time() - start) print(datetime.datetime.now()) raise print(time.time() - start) print(datetime.datetime.now()) # In[ ]: # In[1]:
from classes2 import MCS_Finder import os import time import pickle import datetime start = time.time() with open(family + "/genuses.pickle", "rb")as fi: genlist = pickle.load(fi) try: for genus in genlist: if not os.path.exists(family): os.mkdir(family) if os.path.exists(family + "/" + genus): continue f = MCS_Finder(genus, family) f.make_kcfs() print(datetime.datetime.now()) print(len(os.listdir(family))) time.sleep(15) except: print(time.time() - start) print(datetime.datetime.now()) raise print(time.time() - start) print(datetime.datetime.now()) # ミカン科抜き終わり。 # In[20]:
from classes2 import MCS_Finder import os import time import pickle import datetime start = time.time() with open("Fabaceae/genuses.pickle", "rb") as fi: genlist = pickle.load(fi) try: for genus in genlist: if not os.path.exists("Fabaceae"): os.mkdir("Fabaceae") if os.path.exists("Fabaceae/" + genus): continue f = MCS_Finder(genus, "Fabaceae") f.make_kcfs() print(datetime.datetime.now()) print(len(os.listdir("Fabaceae"))) time.sleep(15) except: print(time.time() - start) print(datetime.datetime.now()) raise print(time.time() - start) print(datetime.datetime.now()) # 抜き終わり # In[ ]:
from classes2 import MCS_Finder import os import time import pickle import datetime start = time.time() with open(family + "/genuses.pickle", "rb") as fi: genlist = pickle.load(fi) try: for genus in genlist: if not os.path.exists(family): os.mkdir(family) if os.path.exists(family + "/" + genus): continue f = MCS_Finder(genus, family) f.make_kcfs(limit=10000) print(datetime.datetime.now()) print(len(os.listdir(family))) time.sleep(15) except: os.rmdir(family + "/" + genus) print(time.time() - start) print(datetime.datetime.now()) raise print(time.time() - start) print(datetime.datetime.now()) # In[22]: print(genlist[11])