climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omk...@apache.org
Subject [08/16] climate git commit: Adding podaac to dataset_loader.py and updating the tests
Date Sat, 27 Aug 2016 03:42:30 GMT
Adding podaac to dataset_loader.py and updating the tests


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

Branch: refs/heads/master
Commit: a67ea7d4d1b7da5e5fa0708fe1d6b0994eb55c27
Parents: 21a78ab
Author: Omkar20895 <omkarreddy2008@gmail.com>
Authored: Sun Aug 21 00:17:38 2016 +0530
Committer: Omkar20895 <omkarreddy2008@gmail.com>
Committed: Sun Aug 21 00:17:38 2016 +0530

----------------------------------------------------------------------
 ocw/data_source/podaac.py | 2 +-
 ocw/dataset_loader.py     | 6 +++++-
 ocw/tests/test_podaac.py  | 3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/a67ea7d4/ocw/data_source/podaac.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/podaac.py b/ocw/data_source/podaac.py
index b4085e8..e7d7b68 100644
--- a/ocw/data_source/podaac.py
+++ b/ocw/data_source/podaac.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from podaac_data_source import Podaac
+from podaac.podaac_data_source import Podaac
 import numpy as np
 from ocw.dataset import Dataset
 from netCDF4 import Dataset as netcdf_dataset

http://git-wip-us.apache.org/repos/asf/climate/blob/a67ea7d4/ocw/dataset_loader.py
----------------------------------------------------------------------
diff --git a/ocw/dataset_loader.py b/ocw/dataset_loader.py
index 7c90123..a4f3466 100644
--- a/ocw/dataset_loader.py
+++ b/ocw/dataset_loader.py
@@ -24,6 +24,7 @@ import ocw.data_source.local as local
 import ocw.data_source.esgf as esgf
 import ocw.data_source.rcmed as rcmed
 import ocw.data_source.dap as dap
+import ocw.data_source.podaac as podaac
 
 
 class DatasetLoader:
@@ -69,6 +70,8 @@ class DatasetLoader:
         * ``'rcmed'`` - Download the dataset from the Regional Climate Model
                         Evaluation System Database
         * ``'dap'`` - Download the dataset from an OPeNDAP URL
+        * ``'podaac'`` - Download the dataset from Physical Oceanography
+                        Distributed Active Archive Center
 
         Users who wish to load datasets from loaders not described above may
         define their own custom dataset loader function and incorporate it as
@@ -94,7 +97,8 @@ class DatasetLoader:
             'local_split': local.load_dataset_from_multiple_netcdf_files,
             'esgf': esgf.load_dataset,
             'rcmed': rcmed.parameter_dataset,
-            'dap': dap.load
+            'dap': dap.load,
+            'podaac': podaac.load_dataset
         }
 
     def add_source_loader(self, loader_name, loader_func):

http://git-wip-us.apache.org/repos/asf/climate/blob/a67ea7d4/ocw/tests/test_podaac.py
----------------------------------------------------------------------
diff --git a/ocw/tests/test_podaac.py b/ocw/tests/test_podaac.py
index 04712b8..b2d4402 100644
--- a/ocw/tests/test_podaac.py
+++ b/ocw/tests/test_podaac.py
@@ -19,6 +19,7 @@
 import ocw.data_source.podaac as podaac
 import unittest
 import os
+import datetime as dt
 from ocw.dataset import Dataset
 
 
@@ -51,7 +52,7 @@ class TestPodaacDataSource(unittest.TestCase):
         self.assertEquals(len(self.dataset.values), 1)
 
     def test_valid_date_conversion(self):
-        start = dt.datetime(2006, 6, 7, 12)
+        start = dt.datetime(1991, 9, 2, 12)
         self.assertTrue(start == self.dataset.times[0])
 
     def test_dataset_origin(self):


Mime
View raw message