Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions experiment/template/eVOLVER.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,14 @@ def _create_file(self, vial, param, directory=None, defaults=None):
text_file.write(default + '\n')
text_file.close()

def initialize_exp(self, vials, experiment_params, always_yes = False):
def initialize_exp(self, vials, experiment_params, always_yes = False, exp_recover = False):
self.experiment_params = experiment_params
logger.debug('initializing experiment')

if os.path.exists(EXP_DIR):
logger.info('found an existing experiment')
exp_continue = None
if always_yes:
if always_yes | exp_recover:
exp_continue = 'y'
else:
while exp_continue not in ['y', 'n']:
Expand Down Expand Up @@ -576,6 +576,11 @@ def get_options():
'(i.e. continues from existing experiment, '
'overwrites existing data and blanks OD '
'measurements)')
parser.add_argument('--exp-recover', action='store_true',
default=False,
help='Continues experiment without overwriting information'
'(i.e. continues experiment without overwriting)'
' existing data or blank measurements')
parser.add_argument('--log-name',
default=os.path.join(EXP_DIR, 'evolver.log'),
help='Log file name directory (default: %(default)s)')
Expand Down Expand Up @@ -613,10 +618,11 @@ def get_options():
EVOLVER_NS.start_time = EVOLVER_NS.initialize_exp(VIALS,
experiment_params,
options.always_yes,
options.exp_recover
)

# Using a non-blocking stream reader to be able to listen
# for commands from the electron app.
# for commands from the electron app.
nbsr = NBSR(sys.stdin)
paused = False

Expand All @@ -635,7 +641,7 @@ def get_options():
level=level)

reset_connection_timer = time.time()
while True:
while True:
try:
# infinite loop

Expand All @@ -647,7 +653,7 @@ def get_options():
paused = True
EVOLVER_NS.stop_exp()
socketIO.disconnect()

if 'continue-script' in message:
print('Restarting experiment', flush = True)
paused = False
Expand Down