Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Fixing some bugs found from testing
  • Loading branch information
agoodm committed Jul 25, 2016
1 parent 4add58b commit 198de48332c84586dafcaf033fa27a8eb8818ebe
Showing 1 changed file with 13 additions and 13 deletions.
@@ -92,18 +92,18 @@ def __init__(self, reference, targets):
loader function.
'''
# Reference dataset config
self.set_reference(reference)
self.set_reference(**reference)

# Target dataset(s) config
self.set_targets(targets)

# Default loaders
self._source_loaders = {
'local':local.load,
'local_split':local.load_dataset_from_multiple_netcdf_files
'local':local.load_file,
'local_split':local.load_dataset_from_multiple_netcdf_files,
'local_multiple':local.load_multiple_files,
'esgf':esgf.load_dataset,
'rcmed':parameter_dataset,
'rcmed':rcmed.parameter_dataset,
'dap':dap.load
}

@@ -118,7 +118,7 @@ def add_source_loader(self, source_name, loader_func):
return an OCW Dataset object.
:type loader_func: :class:`callable`
'''
self._source_loader[source_name] = loader_func
self._source_loaders[source_name] = loader_func

def add_target(self, **kwargs):
'''
@@ -152,7 +152,7 @@ def set_targets(self, targets):
'''
# This check allows for the user to enter targets as one block or
# as a list of separate blocks in their config files
if not instanceof(targets, list):
if not isinstance(targets, list):
targets = [targets]
self._target_config = []
self.add_targets(targets)
@@ -178,15 +178,15 @@ def load_datasets(self):
self.target_datasets = []

# Load the target datasets
for loader_params in self._target_config
for loader_params in self._target_config:
output = self._load(**loader_params)

# Need to account for the fact that some loaders return lists
# of OCW Dataset objects instead of just one
if isinstance(target_dataset, list):
self.target_datasets.extend(output)
else:
self.target_datasets.append(output)
# Need to account for the fact that some loaders return lists
# of OCW Dataset objects instead of just one
if isinstance(output, list):
self.target_datasets.extend(output)
else:
self.target_datasets.append(output)

def _load(self, **kwargs):
'''

0 comments on commit 198de48

Please sign in to comment.