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
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
#!/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]