Repository: climate
Updated Branches:
  refs/heads/master d56dff1cb -> 1adafc136


CLIMATE-372 - Add custom names to local data source


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

Branch: refs/heads/master
Commit: aefdffeac216f3a7828bce539fe95abb31efd3e7
Parents: d56dff1
Author: Michael Joyce <[email protected]>
Authored: Mon Nov 17 09:15:38 2014 -0800
Committer: Michael Joyce <[email protected]>
Committed: Mon Nov 17 09:15:38 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/climate/blob/aefdffea/ocw/data_source/local.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/local.py b/ocw/data_source/local.py
index acd8b7d..5fd0571 100644
--- a/ocw/data_source/local.py
+++ b/ocw/data_source/local.py
@@ -112,6 +112,7 @@ def _get_netcdf_variable_name(valid_var_names, netcdf, 
netcdf_var):
 def load_file(file_path,
               variable_name,
               elevation_index=0,
+              name='',
               lat_name=None,
               lon_name=None,
               time_name=None):
@@ -128,6 +129,8 @@ def load_file(file_path,
         By default, the first elevation layer is used. If desired you may
         specify the elevation value to use.
     :type elevation_index: Integer
+    :param name: (Optional) A name for the loaded dataset.
+    :type name: String
     :param lat_name: (Optional) The latitude variable name to extract from the
         dataset.
     :type lat_name: String
@@ -197,4 +200,4 @@ def load_file(file_path,
         else:
             values = values [:,:,:,elevation_index]
 
-    return Dataset(lats, lons, times, values, variable_name)
+    return Dataset(lats, lons, times, values, variable_name, name=name)

Reply via email to