Skip to content

Commit

Permalink
Add error when output_dir not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-harkins committed Feb 28, 2023
1 parent e578a4c commit 0d675ac
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions melodies_monet/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,11 @@ def read_control(self, control=None):
# set analysis time
self.start_time = pd.Timestamp(self.control_dict['analysis']['start_time'])
self.end_time = pd.Timestamp(self.control_dict['analysis']['end_time'])
self.output_dir = os.path.expandvars(
self.control_dict['analysis']['output_dir'])
if 'output_dir' in self.control_dict['analysis'].keys():
self.output_dir = os.path.expandvars(
self.control_dict['analysis']['output_dir'])
else:
raise Exception('output_dir was not specified and is required. Please set analysis.output_dir in the control file.')
if 'output_dir_save' in self.control_dict['analysis'].keys():
self.output_dir_save = os.path.expandvars(
self.control_dict['analysis']['output_dir_save'])
Expand Down

0 comments on commit 0d675ac

Please sign in to comment.