take conditional out of remove_db
@@ -1461,7 +1461,6 @@ class Calibration(Analyzer):
def remove_db(self):
''' Remove the database file if keep_db is false and the path exists '''
- if not self.run_args.keep_db:
if os.path.exists(self.run_args.db_name):
os.remove(self.run_args.db_name)
if self.verbose:
@@ -1471,6 +1470,7 @@ class Calibration(Analyzer):
def make_study(self):
''' Make a study, deleting one if it already exists '''
+ if not self.run_args.keep_db:
self.remove_db()
output = op.create_study(storage=self.run_args.storage, study_name=self.run_args.name)
return output
@@ -1509,6 +1509,7 @@ class Calibration(Analyzer):
# Tidy up
self.calibrated = True
+ if not self.run_args.keep_db:
self.remove_db()
if verbose:
self.summarize()
