예제 #1
0
 def create_workdir(self, wd):
     state = None
     if os.path.exists(wd):
         while True:
             ans = raw_input("%s already exists. Continue learning? (y/n): " % (wd))
             if ans in ["Y","y"]:
                 state = State.read_from_dir(wd) 
                 break
             elif ans in ["N", "n"]:
                 logging.warning("Deleting {}".format(wd))
                 shutil.rmtree(wd)
                 make_dir(wd)
                 break                        
             else:
                 logging.warning("incomprehensible answer")
     else:
         make_dir(wd)
     return wd, state
예제 #2
0
 def create_workdir(self, wd):
     state = None
     if os.path.exists(wd):
         while True:
             ans = raw_input(
                 "%s already exists. Continue learning? (y/n): " % (wd))
             if ans in ["Y", "y"]:
                 state = State.read_from_dir(wd)
                 break
             elif ans in ["N", "n"]:
                 logging.warning("Deleting {}".format(wd))
                 shutil.rmtree(wd)
                 make_dir(wd)
                 break
             else:
                 logging.warning("incomprehensible answer")
     else:
         make_dir(wd)
     return wd, state
예제 #3
0
#!/usr/bin/env python


from lib.evolve_state import State
import sys

state = State.read_from_dir(sys.argv[1])

for v in state.vals:
    for vv in v[0]:
        for ii, vvv in enumerate(vv):
            print "{0:.12f}".format(vvv),
    print v[1][0]