You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by om...@apache.org on 2016/08/19 14:47:13 UTC
[1/2] climate git commit: CLIMATE-853 Fixing broken documentation in
dap.py and making it PEP8 compliant
Repository: climate
Updated Branches:
refs/heads/master 28964ae74 -> 7e53612bd
CLIMATE-853 Fixing broken documentation in dap.py and making it PEP8 compliant
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/83c19de7
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/83c19de7
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/83c19de7
Branch: refs/heads/master
Commit: 83c19de75b0976e0b06a0a6c8b171ea4bb901ce9
Parents: 817c854
Author: Omkar20895 <om...@gmail.com>
Authored: Wed Aug 17 22:50:22 2016 +0530
Committer: Omkar20895 <om...@gmail.com>
Committed: Wed Aug 17 22:50:22 2016 +0530
----------------------------------------------------------------------
ocw/data_source/dap.py | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/83c19de7/ocw/data_source/dap.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/dap.py b/ocw/data_source/dap.py
index fc9d2a3..663bc36 100644
--- a/ocw/data_source/dap.py
+++ b/ocw/data_source/dap.py
@@ -47,18 +47,21 @@ def load(url, variable, name=''):
# but conventions aren't always followed and all dimensions aren't always present so
# see if we can make some educated deductions before defaulting to just pulling the first three
# columns.
- temp_dimensions = map(lambda x:x.lower(),dataset.dimensions)
+ temp_dimensions = map(lambda x: x.lower(), dataset.dimensions)
dataset_dimensions = dataset.dimensions
- time = dataset_dimensions[temp_dimensions.index('time') if 'time' in temp_dimensions else 0]
- lat = dataset_dimensions[temp_dimensions.index('lat') if 'lat' in temp_dimensions else 1]
- lon = dataset_dimensions[temp_dimensions.index('lon') if 'lon' in temp_dimensions else 2]
+ time = dataset_dimensions[temp_dimensions.index(
+ 'time') if 'time' in temp_dimensions else 0]
+ lat = dataset_dimensions[temp_dimensions.index(
+ 'lat') if 'lat' in temp_dimensions else 1]
+ lon = dataset_dimensions[temp_dimensions.index(
+ 'lon') if 'lon' in temp_dimensions else 2]
# Time is given to us in some units since an epoch. We need to convert
# these values to datetime objects. Note that we use the main object's
# time object and not the dataset specific reference to it. We need to
# grab the 'units' from it and it fails on the dataset specific object.
- times = np.array(_convert_times_to_datetime(d[time]))
+ times = np.array(convert_times_to_datetime(d[time]))
lats = np.array(dataset[lat][:])
lons = np.array(dataset[lon][:])
@@ -73,7 +76,7 @@ def load(url, variable, name=''):
name=name, origin=origin)
-def _convert_times_to_datetime(time):
+def convert_times_to_datetime(time):
'''Convert the OpenDAP time object's values to datetime objects
The time values are stored as some unit since an epoch. These need to be
[2/2] climate git commit: Merge branch 'CLIMATE-853'
Posted by om...@apache.org.
Merge branch 'CLIMATE-853'
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/7e53612b
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/7e53612b
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/7e53612b
Branch: refs/heads/master
Commit: 7e53612bd78a86b2ac3ce88d5e82b41c66e13b5d
Parents: 28964ae 83c19de
Author: Omkar20895 <om...@gmail.com>
Authored: Fri Aug 19 20:16:16 2016 +0530
Committer: Omkar20895 <om...@gmail.com>
Committed: Fri Aug 19 20:16:16 2016 +0530
----------------------------------------------------------------------
ocw/data_source/dap.py | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------