Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9E39C200B5F for ; Fri, 29 Jul 2016 20:31:40 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9D108160A6E; Fri, 29 Jul 2016 18:31:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 736CF160AB1 for ; Fri, 29 Jul 2016 20:31:39 +0200 (CEST) Received: (qmail 2819 invoked by uid 500); 29 Jul 2016 18:31:38 -0000 Mailing-List: contact commits-help@climate.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.apache.org Delivered-To: mailing list commits@climate.apache.org Received: (qmail 2486 invoked by uid 99); 29 Jul 2016 18:31:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2016 18:31:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4C41BED225; Fri, 29 Jul 2016 18:31:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: goodman@apache.org To: commits@climate.apache.org Date: Fri, 29 Jul 2016 18:31:43 -0000 Message-Id: <9f446cbf637e4f269e92c5be6902b5a0@git.apache.org> In-Reply-To: <0ad538cd2d06495c800336f26cef7d6b@git.apache.org> References: <0ad538cd2d06495c800336f26cef7d6b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/11] climate git commit: Fixing some bugs found from testing archived-at: Fri, 29 Jul 2016 18:31:40 -0000 Fixing some bugs found from testing Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/198de483 Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/198de483 Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/198de483 Branch: refs/heads/master Commit: 198de48332c84586dafcaf033fa27a8eb8818ebe Parents: 4add58b Author: Alex Goodman Authored: Mon Jul 25 16:13:48 2016 -0700 Committer: Alex Goodman Committed: Mon Jul 25 16:13:48 2016 -0700 ---------------------------------------------------------------------- ocw/dataset_loader.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/198de483/ocw/dataset_loader.py ---------------------------------------------------------------------- diff --git a/ocw/dataset_loader.py b/ocw/dataset_loader.py index 2eb9ef0..be43c05 100644 --- a/ocw/dataset_loader.py +++ b/ocw/dataset_loader.py @@ -92,18 +92,18 @@ class DatasetLoader: 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 @@ class DatasetLoader: 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 @@ class DatasetLoader: ''' # 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 @@ class DatasetLoader: 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): '''