Skip to content
Merged
12 changes: 7 additions & 5 deletions esmvaltool/cmorizers/data/cmorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

import esmvalcore
import yaml
from esmvalcore._config import configure_logging, read_config_user_file
from esmvalcore._task import write_ncl_settings
from esmvalcore.config import CFG
from esmvalcore.config._logging import configure_logging

from esmvaltool.cmorizers.data.utilities import read_cmor_config

Expand Down Expand Up @@ -57,8 +58,9 @@ def start(self, command, datasets, config_file, options):
else:
self.datasets = datasets

self.config = read_config_user_file(config_file, f'data_{command}',
options)
CFG.load_from_file(config_file)
CFG.update(options)
self.config = CFG.start_session(f'data_{command}')

if not os.path.isdir(self.run_dir):
os.makedirs(self.run_dir)
Expand Down Expand Up @@ -92,12 +94,12 @@ def rawobs(self):
@property
def output_dir(self):
"""Output folder path."""
return self.config['output_dir']
return self.config.session_dir

@property
def run_dir(self):
"""Run dir folder path."""
return os.path.join(self.config['output_dir'], 'run')
return self.config.run_dir

@property
def log_level(self):
Expand Down