Commit 9f8d0be1 authored by David Keitel's avatar David Keitel
Browse files

gridsearch: fix old-data check in transient case, add filenames to logging

parent 0c41b602
...@@ -128,7 +128,7 @@ class GridSearch(BaseSearchClass): ...@@ -128,7 +128,7 @@ class GridSearch(BaseSearchClass):
if args.clean: if args.clean:
return False return False
if os.path.isfile(self.out_file) is False: if os.path.isfile(self.out_file) is False:
logging.info('No old data found, continuing with grid search') logging.info('No old data found in "{:s}", continuing with grid search'.format(self.out_file))
return False return False
if self.sftfilepattern is not None: if self.sftfilepattern is not None:
oldest_sft = min([os.path.getmtime(f) for f in oldest_sft = min([os.path.getmtime(f) for f in
...@@ -139,13 +139,13 @@ class GridSearch(BaseSearchClass): ...@@ -139,13 +139,13 @@ class GridSearch(BaseSearchClass):
return False return False
data = np.atleast_2d(np.genfromtxt(self.out_file, delimiter=' ')) data = np.atleast_2d(np.genfromtxt(self.out_file, delimiter=' '))
if np.all(data[:, 0:-1] == self.input_data): if np.all(data[:,0:len(self.coord_arrays)] == self.input_data[:,0:len(self.coord_arrays)]):
logging.info( logging.info(
'Old data found with matching input, no search performed') 'Old data found in "{:s}" with matching input, no search performed'.format(self.out_file))
return data return data
else: else:
logging.info( logging.info(
'Old data found, input differs, continuing with grid search') 'Old data found in "{:s}", input differs, continuing with grid search'.format(self.out_file))
return False return False
return False return False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment