You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2014/11/19 17:53:20 UTC

[05/21] climate git commit: CLIMATE-372 - Add custom naming to esgf data source

CLIMATE-372 - Add custom naming to esgf data source


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/2b264b37
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/2b264b37
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/2b264b37

Branch: refs/heads/master
Commit: 2b264b370419a3deee3802122407aef1cb70b24a
Parents: ddfe069
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 09:27:33 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 09:27:33 2014 -0800

----------------------------------------------------------------------
 ocw/data_source/esgf.py | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/2b264b37/ocw/data_source/esgf.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/esgf.py b/ocw/data_source/esgf.py
index 084a73d..11eb138 100644
--- a/ocw/data_source/esgf.py
+++ b/ocw/data_source/esgf.py
@@ -34,6 +34,7 @@ def load_dataset(dataset_id,
                  esgf_password,
                  search_url=DEFAULT_ESGF_SEARCH,
                  elevation_index=0,
+                 name='',
                  **additional_constraints):
     ''' Load an ESGF dataset.
 
@@ -50,6 +51,8 @@ def load_dataset(dataset_id,
     :type search_url: String
     :param elevation_index: (Optional) The elevation level to strip out when
         loading the dataset using ocw.data_source.local.
+    :param name: (Optional) A name for the loaded dataset.
+    :type name: String
     :param additional_constraints: (Optional) Additional key,value pairs to
         pass as constraints to the search wrapper. These can be anything found
         on the ESGF metadata page for a dataset.
@@ -70,6 +73,7 @@ def load_dataset(dataset_id,
         _download_files([url], esgf_username, esgf_password)
         datasets.append(local.load_file('/tmp/' + url.split('/')[-1],
                                         var,
+                                        name=name,
                                         elevation_index=elevation_index))
 
     return datasets