(self, directory, overwrite=False)
convenience logger for 'semi-live-results'

		Logger that writes job results into two files (configs.json and results.json).
		Both files contain propper json objects in each line.

		This version opens and closes the files for each result.
		This might be very slow if individual runs are fast and the
		filesystem is rather slow (e.g. a NFS).

		Parameters
		----------

		directory: string
			the directory where the two files 'configs.json' and
			'results.json' are stored
		overwrite: bool
			In case the files already exist, this flag controls the
			behavior:
			
				* True:   The existing files will be overwritten. Potential risk of deleting previous results
				* False:  A FileExistsError is raised and the files are not modified.
convenience logger for 'semi-live-results'
convenience logger for semi - live - results
def __init__(self, directory, overwrite=False):
		"""
		convenience logger for 'semi-live-results'

		Logger that writes job results into two files (configs.json and results.json).
		Both files contain propper json objects in each line.

		This version opens and closes the files for each result.
		This might be very slow if individual runs are fast and the
		filesystem is rather slow (e.g. a NFS).

		Parameters
		----------

		directory: string
			the directory where the two files 'configs.json' and
			'results.json' are stored
		overwrite: bool
			In case the files already exist, this flag controls the
			behavior:
			
				* True:   The existing files will be overwritten. Potential risk of deleting previous results
				* False:  A FileExistsError is raised and the files are not modified.
		"""

		os.makedirs(directory, exist_ok=True)

		
		self.config_fn  = os.path.join(directory, 'configs.json')
		self.results_fn = os.path.join(directory, 'results.json')


		try:
			with open(self.config_fn, 'x') as fh: pass
		except FileExistsError:
			if overwrite:
				with open(self.config_fn, 'w') as fh: pass
			else:
				raise FileExistsError('The file %s already exists.'%self.config_fn)
		except:
			raise

		try:
			with open(self.results_fn, 'x') as fh: pass
		except FileExistsError:
			if overwrite:
				with open(self.results_fn, 'w') as fh: pass
			else:
				raise FileExistsError('The file %s already exists.'%self.config_fn)

		except:
			raise

		self.config_ids = set()
def __init__ ( self , directory , overwrite = False ) : os . makedirs ( directory , exist_ok = True ) self . config_fn = os . path . join ( directory , 'configs.json' ) self . results_fn = os . path . join ( directory , 'results.json' ) try : with open ( self . config_fn , 'x' ) as fh : pass except FileExistsError : if overwrite : with open ( self . config_fn , 'w' ) as fh : pass else : raise FileExistsError ( 'The file %s already exists.' % self . config_fn ) except : raise try : with open ( self . results_fn , 'x' ) as fh : pass except FileExistsError : if overwrite : with open ( self . results_fn , 'w' ) as fh : pass else : raise FileExistsError ( 'The file %s already exists.' % self . config_fn ) except : raise self . config_ids = set ( )