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:16 UTC

[01/21] climate git commit: CLIMATE-372 - Add custom names to local data source

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 <jo...@apache.org>
Authored: Mon Nov 17 09:15:38 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
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)


[11/21] climate git commit: CLIMATE-558 - Update Evaluation module documentation links

Posted by jo...@apache.org.
CLIMATE-558 - Update Evaluation module documentation links


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

Branch: refs/heads/master
Commit: ed67393180a60e736467169ff82560f5c0c8db70
Parents: ac417f8
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 11:20:55 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 11:20:55 2014 -0800

----------------------------------------------------------------------
 ocw/evaluation.py | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/ed673931/ocw/evaluation.py
----------------------------------------------------------------------
diff --git a/ocw/evaluation.py b/ocw/evaluation.py
index 237ea27..96c19ad 100644
--- a/ocw/evaluation.py
+++ b/ocw/evaluation.py
@@ -54,16 +54,19 @@ class Evaluation(object):
         '''Default Evaluation constructor.
 
         :param reference: The reference Dataset for the evaluation.
-        :type reference: Dataset
+        :type reference: :class:`dataset.Dataset`
+
         :param targets: A list of one or more target datasets for the 
                 evaluation.
-        :type targets: List of Datasets
+        :type targets: :class:`list` of :class:`dataset.Dataset`
+
         :param metrics: A list of one or more Metric instances to run 
                 in the evaluation.
-        :type metrics: List of Metrics
+        :type metrics: :class:`list` of :mod:`metrics`
+
         :param subregions: (Optional) Subregion information to use in the
                 evaluation. A subregion is specified with a Bounds object.
-        :type subregions: List of Bounds objects
+        :type subregions: :class:`list` of :class:`dataset.Bounds`
 
         :raises: ValueError 
         '''
@@ -138,7 +141,7 @@ class Evaluation(object):
         Evaluation is run with one or more metrics.
 
         :param target_dataset: The target Dataset to add to the Evaluation.
-        :type target_dataset: Dataset
+        :type target_dataset: :class:`dataset.Dataset`
 
         :raises ValueError: If a dataset to add isn't an instance of Dataset.
         '''
@@ -157,7 +160,7 @@ class Evaluation(object):
 
         :param target_datasets: The list of datasets that should be added to 
             the Evaluation.
-        :type target_datasets: List of Dataset objects
+        :type target_datasets: :class:`list` of :class:`dataset.Dataset`
 
         :raises ValueError: If a dataset to add isn't an instance of Dataset.
         '''
@@ -170,7 +173,7 @@ class Evaluation(object):
         A metric is an instance of a class which inherits from metrics.Metric.
 
         :param metric: The metric instance to add to the Evaluation.
-        :type metric: Metric
+        :type metric: :mod:`metrics`
 
         :raises ValueError: If the metric to add isn't a class that inherits
                 from metrics.Metric.
@@ -194,7 +197,7 @@ class Evaluation(object):
         A metric is an instance of a class which inherits from metrics.Metric.
 
         :param metrics: The list of metric instances to add to the Evaluation.
-        :type metrics: List of Metrics
+        :type metrics: :class:`list` of :mod:`metrics`
 
         :raises ValueError: If a metric to add isn't a class that inherits
                 from metrics.Metric.


[17/21] climate git commit: CLIMATE-558 - Update ESGF module documentation links

Posted by jo...@apache.org.
CLIMATE-558 - Update ESGF module documentation links


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

Branch: refs/heads/master
Commit: ff85d6f10c61f3fe8bb69e2b3d1c992f7924d59c
Parents: 016bd67
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 12:50:22 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 12:50:22 2014 -0800

----------------------------------------------------------------------
 ocw/data_source/esgf.py | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/ff85d6f1/ocw/data_source/esgf.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/esgf.py b/ocw/data_source/esgf.py
index 084a73d..1e8038d 100644
--- a/ocw/data_source/esgf.py
+++ b/ocw/data_source/esgf.py
@@ -38,25 +38,32 @@ def load_dataset(dataset_id,
     ''' Load an ESGF dataset.
 
     :param dataset_id: The ESGF ID of the dataset to load.
-    :type dataset_id: String
+    :type dataset_id: :mod:`string`
+
     :param variable: The variable to load.
-    :type variable: String
+    :type variable: :mod:`string`
+
     :param esgf_username: ESGF OpenID value to use for authentication.
-    :type esgf_username: String
+    :type esgf_username: :mod:`string`
+
     :param esgf_password: ESGF Password to use for authentication.
-    :type esgf_password: String
+    :type esgf_password: :mod:`string`
+
     :param search_url: (Optional) The ESGF node to use for searching. Defaults
         to the Jet Propulsion Laboratory node.
-    :type search_url: String
+    :type search_url: :mod:`string`
+
     :param elevation_index: (Optional) The elevation level to strip out when
         loading the dataset using ocw.data_source.local.
+    :type elevation_index: :class:`int`
+
     :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.
 
-    :returns: A list of ocw.dataset.Dataset objects contained the requested
-        dataset. If the dataset is stored in multiple files each will be loaded
-        into a separate ocw.dataset.Dataset object.
+    :returns: A :class:`list` of :class:`dataset.Dataset` contained the
+        requested dataset. If the dataset is stored in multiple files each will
+        be loaded into a separate :class:`dataset.Dataset`.
 
     :raises ValueError: If no dataset can be found for the supplied ID and
         variable, or if the requested dataset is a multi-file dataset.


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

Posted by jo...@apache.org.
CLIMATE-372 - Add custom naming to RCMED data source


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

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

----------------------------------------------------------------------
 ocw/data_source/rcmed.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/a600a04b/ocw/data_source/rcmed.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/rcmed.py b/ocw/data_source/rcmed.py
index 410bf48..16cc21c 100644
--- a/ocw/data_source/rcmed.py
+++ b/ocw/data_source/rcmed.py
@@ -312,7 +312,7 @@ def _get_parameter_info(parameters_metadata, parameter_id):
     return (database, time_step, realm, instrument, start_date, end_date, unit)
 
 
-def parameter_dataset(dataset_id, parameter_id, min_lat, max_lat, min_lon, max_lon, start_time, end_time):
+def parameter_dataset(dataset_id, parameter_id, min_lat, max_lat, min_lon, max_lon, start_time, end_time, name=''):
     '''Get data from one database(parameter).
 
     :param dataset_id: Dataset id.
@@ -331,6 +331,8 @@ def parameter_dataset(dataset_id, parameter_id, min_lat, max_lat, min_lon, max_l
     :type start_time: Datetime
     :param end_time: End time 
     :type end_time: Datetime
+    :param name: (Optional) A name for the loaded dataset.
+    :type name: String
 
     :returns: An OCW Dataset object contained the requested data from RCMED.
     :rtype: ocw.dataset.Dataset object
@@ -346,4 +348,4 @@ def parameter_dataset(dataset_id, parameter_id, min_lat, max_lat, min_lon, max_l
     values = _reshape_values(values, unique_lats_lons_times)
     values = _make_mask_array(values, parameter_id, parameters_metadata)
     
-    return Dataset(unique_lats_lons_times[0], unique_lats_lons_times[1], unique_times, values, parameter_name)
+    return Dataset(unique_lats_lons_times[0], unique_lats_lons_times[1], unique_times, values, parameter_name, name=name)


[04/21] climate git commit: CLIMATE-372 - Testing dap custom dataset name test

Posted by jo...@apache.org.
CLIMATE-372 - Testing dap custom dataset name test


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

Branch: refs/heads/master
Commit: ddfe06929cb738d2f73dfc8e3398ff642331adf2
Parents: 79fa8a6
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 09:23:52 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 09:23:52 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/climate/blob/ddfe0692/ocw/tests/test_dap.py
----------------------------------------------------------------------
diff --git a/ocw/tests/test_dap.py b/ocw/tests/test_dap.py
index cdc75cd..be01f6c 100644
--- a/ocw/tests/test_dap.py
+++ b/ocw/tests/test_dap.py
@@ -23,7 +23,7 @@ import datetime as dt
 class TestDap(unittest.TestCase):
     @classmethod
     def setup_class(self):
-        dataset = dap.load('http://test.opendap.org/dap/data/nc/sst.mnmean.nc.gz', 'sst')
+        self.dataset = dap.load('http://test.opendap.org/dap/data/nc/sst.mnmean.nc.gz', 'sst', name='foo')
 
     def test_dataset_is_returned(self):
         self.assertTrue(isinstance(self.dataset, Dataset))
@@ -41,5 +41,8 @@ class TestDap(unittest.TestCase):
         start = dt.datetime(1854, 1, 1)
         self.assertTrue(start == self.dataset.times[0])
 
+    def test_custom_dataset_name(self):
+        self.assertEquals(self.dataset.name, 'foo')
+
 if __name__ == '__main__':
     unittest.main()


[20/21] climate git commit: Resolve CLIMATE-372. Merge PR #138.

Posted by jo...@apache.org.
Resolve CLIMATE-372. Merge PR #138.


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

Branch: refs/heads/master
Commit: a5c394e73b95b45e32109891b068165b4aec5fbf
Parents: d56dff1 197530e
Author: Michael Joyce <jo...@apache.org>
Authored: Wed Nov 19 08:48:01 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Wed Nov 19 08:48:01 2014 -0800

----------------------------------------------------------------------
 ocw/data_source/dap.py   | 6 ++++--
 ocw/data_source/esgf.py  | 4 ++++
 ocw/data_source/local.py | 5 ++++-
 ocw/data_source/rcmed.py | 6 ++++--
 ocw/tests/test_dap.py    | 5 ++++-
 ocw/tests/test_local.py  | 5 +++++
 ocw/tests/test_rcmed.py  | 7 ++++++-
 7 files changed, 31 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[02/21] climate git commit: CLIMATE-372 - Testing local custom dataset name test

Posted by jo...@apache.org.
CLIMATE-372 - Testing local custom dataset name test


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

Branch: refs/heads/master
Commit: f6f1dd6843cb1ff5aa3068d01b9c570c54a3920d
Parents: aefdffe
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 09:16:21 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 09:16:21 2014 -0800

----------------------------------------------------------------------
 ocw/tests/test_local.py | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/f6f1dd68/ocw/tests/test_local.py
----------------------------------------------------------------------
diff --git a/ocw/tests/test_local.py b/ocw/tests/test_local.py
index ac49485..27f4245 100644
--- a/ocw/tests/test_local.py
+++ b/ocw/tests/test_local.py
@@ -64,6 +64,11 @@ class test_load_file(unittest.TestCase):
         new_values = self.values[0,:,:,:]
         self.assertTrue(numpy.allclose(local.load_file(self.file_path, "value").values, new_values))
 
+    def test_custom_dataset_name(self):
+        '''Test adding a custom name to a dataset'''
+        ds = local.load_file(self.file_path, 'value', name='foo')
+        self.assertEqual(ds.name, 'foo')
+
 class test_get_netcdf_variable_names(unittest.TestCase):
     file_path = "http://zipper.jpl.nasa.gov/dist/"
     test_model = "AFRICA_KNMI-RACMO2.2b_CTL_ERAINT_MM_50km_1989-2008_tasmax.nc"


[15/21] climate git commit: CLIMATE-558 - Update Utils module documentation links

Posted by jo...@apache.org.
CLIMATE-558 - Update Utils module documentation links


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

Branch: refs/heads/master
Commit: 619997efcf5c9734380403b41597560fef2fee84
Parents: 33a52ea
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 12:38:18 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 12:38:18 2014 -0800

----------------------------------------------------------------------
 ocw/utils.py | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/619997ef/ocw/utils.py
----------------------------------------------------------------------
diff --git a/ocw/utils.py b/ocw/utils.py
index defe3d1..c4b640f 100644
--- a/ocw/utils.py
+++ b/ocw/utils.py
@@ -30,7 +30,7 @@ def decode_time_values(dataset, time_var_name):
     :param dataset: The dataset from which time values should be extracted.
     :type dataset: netCDF4.Dataset
     :param time_var_name: The name of the time variable in dataset.
-    :type time_var_name: String
+    :type time_var_name: :mod:`string`
 
     :returns: The list of converted datetime values.
 
@@ -67,7 +67,7 @@ def parse_time_units(time_format):
     :param time_format: The time data units string from the dataset
         being processed. The string should be of the format
         '<units> since <base time date>'
-    :type time_format: String
+    :type time_format: :mod:`string`
 
     :returns: The unit substring from the time units string
 
@@ -92,7 +92,7 @@ def parse_time_base(time_format):
     :param time_format: The time data units string from the dataset
         being processed. The string should be of the format
         '<units> since <base time date>'
-    :type time_format: String
+    :type time_format: :mod:`string`
 
     :returns: The base time as a datetime object.
 
@@ -143,7 +143,7 @@ def parse_base_time_string(time_format):
     :param time_format: The time data units string from the dataset
         being processed. The string should be of the format
         '<units> since <base time date>'
-    :type time_format: String
+    :type time_format: :mod:`string`
 
     :returns: The base time string split out of the time units information.
 
@@ -169,12 +169,12 @@ def normalize_lat_lon_values(lats, lons, values):
     expected range.
 
     :param lats: A 1D numpy array of sorted lat values.
-    :type lats: Numpy Array
+    :type lats: :class:`numpy.ndarray`
     :param lons: A 1D numpy array of sorted lon values.
-    :type lons: Numpy Array
+    :type lons: :class:`numpy.ndarray`
     :param values: A 3D array of data values.
 
-    :returns: A tuple of the form (adjust_lats, adjusted_lons, adjusted_values)
+    :returns: A :func:`tuple` of the form (adjust_lats, adjusted_lons, adjusted_values)
 
     :raises ValueError: If the lat/lon values are not sorted.
     '''
@@ -232,10 +232,10 @@ def reshape_monthly_to_annually(dataset):
     (24, 90, 180) -> (2, 12, 90, 180)
 
     :param dataset: Dataset object with full-year format
-    :type dataset: ocw.dataset.Dataset object
+    :type dataset: :class:`dataset.Dataset`
 
     :returns: Dataset values array with shape (num_year, 12, num_lat, num_lon)
-    :rtype: Numpy array
+    :rtype: :class:`numpy.ndarray`
     '''
 
     values = dataset.values[:]
@@ -257,11 +257,11 @@ def calc_climatology_year(dataset):
 
     :param dataset: Monthly binned Dataset object with an evenly divisible
         number of months.
-    :type dataset: ocw.dataset.Dataset object
+    :type dataset: :class:`dataset.Dataset`
 
     :returns: Mean values for each year (annual_mean) and mean values for all
         years (total_mean)
-    :rtype: A tuple of two numpy arrays
+    :rtype: A :func:`tuple` of two :class:`numpy.ndarray`
 
     :raise ValueError: If the number of monthly bins is not evenly divisible
         by 12.
@@ -285,16 +285,18 @@ def calc_climatology_season(month_start, month_end, dataset):
     ''' Calculate seasonal mean and time series for given months.
 
     :param month_start: An integer for beginning month (Jan=1)
-    :type month_start: Integer
+    :type month_start: :class:`int`
+
     :param month_end: An integer for ending month (Jan=1)
-    :type month_end: Integer
+    :type month_end: :class:`int`
+
     :param dataset: Dataset object with full-year format
-    :type dataset: ocw.dataset.Dataset object
+    :type dataset: :class:`dataset.Dataset`
 
     :returns:  
         t_series - monthly average over the given season
         means - mean over the entire season
-    :rtype: A tuple of two numpy arrays
+    :rtype: A :func:`tuple` of two :class:`numpy.ndarray`
     '''
 
     if month_start > month_end:
@@ -318,10 +320,10 @@ def calc_climatology_monthly(dataset):
 
     :param dataset: Monthly binned Dataset object with the number of months
         divisible by 12
-    :type dataset: ocw.dataset.Dataset object
+    :type dataset: :class:`dataset.Dataset`
 
     :returns: Mean values for each month of the year
-    :rtype: A 3D numpy array of shape (12, num_lats, num_lons)
+    :rtype: A 3D :class:`numpy.ndarray` of shape (12, num_lats, num_lons)
 
     :raise ValueError: If the number of monthly bins is not divisible by 12
     '''


[09/21] climate git commit: CLIMATE-558 - Update dataset module documentation links

Posted by jo...@apache.org.
CLIMATE-558 - Update dataset module documentation links


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

Branch: refs/heads/master
Commit: cdf6c1305a6725089e7170543b1db4bced163b32
Parents: 544fab0
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 10:42:42 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 10:42:42 2014 -0800

----------------------------------------------------------------------
 ocw/dataset.py | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/cdf6c130/ocw/dataset.py
----------------------------------------------------------------------
diff --git a/ocw/dataset.py b/ocw/dataset.py
index 6cb5e24..1d4b2d8 100644
--- a/ocw/dataset.py
+++ b/ocw/dataset.py
@@ -39,19 +39,24 @@ class Dataset:
         '''Default Dataset constructor
 
         :param lats: One dimensional numpy array of unique latitude values.
-        :type lats: numpy array
+        :type lats: :class:`numpy.ndarray`
+
         :param lons: One dimensional numpy array of unique longitude values.
-        :type lons: numpy array
+        :type lons: :class:`numpy.ndarray`
+
         :param times: One dimensional numpy array of unique python datetime 
             objects.
-        :type times: numpy array
+        :type times: :class:`numpy.ndarray`
+
         :param values: Three dimensional numpy array of parameter values with 
             shape [timesLength, latsLength, lonsLength]. 
-        :type values: numpy array
+        :type values: :class:`numpy.ndarray`
+
         :param variable: Name of the value variable.
-        :type variable: string
+        :type variable: :mod:`string`
+
         :param name: An optional string name for the Dataset.
-        :type variable: string
+        :type name: :mod:`string`
 
         :raises: ValueError
         '''
@@ -70,7 +75,8 @@ class Dataset:
 
         :returns: The Dataset's bounding latitude and longitude values as a
             tuple in the form (min_lat, max_lat, min_lon, max_lon)
-        :rtype: (float, float, float, float)
+        :rtype: :func:`tuple` of the form (:class:`float`, :class:`float`,
+            :class:`float`, :class:`float`).
 
         '''
         return (float(min(self.lats)), float(max(self.lats)),
@@ -82,7 +88,8 @@ class Dataset:
 
         :returns: The start and end date of the Dataset's temporal range as 
             a tuple in the form (start_time, end_time).
-        :rtype: (datetime, datetime)
+        :rtype: :func:`tuple` of the form (:class:`datetime.datetime`,
+            :class:`datetime.datetime`)
         '''
         sorted_time = numpy.sort(self.times)
         start_time = sorted_time[0]
@@ -98,7 +105,7 @@ class Dataset:
 
         :returns: The Dataset's latitudinal and longitudinal spatial resolution
             as a tuple of the form (lat_resolution, lon_resolution).
-        :rtype: (float, float)
+        :rtype: (:class:`float`, :class:`float`)
         '''
         sorted_lats = numpy.sort(list(set(self.lats)))
         sorted_lons = numpy.sort(list(set(self.lons)))
@@ -115,7 +122,7 @@ class Dataset:
             list of times is an unrecognized value a ValueError is raised.
 
         :returns: The temporal resolution.
-        :rtype: string
+        :rtype: :mod:`string`
         '''
         sorted_times = numpy.sort(self.times)
         time_resolution = sorted_times[1] - sorted_times[0]
@@ -221,22 +228,22 @@ class Bounds(object):
         '''Default Bounds constructor
 
         :param lat_min: The minimum latitude bound.
-        :type lat_min: float
+        :type lat_min: :class:`float`
         
         :param lat_max: The maximum latitude bound.
-        :type lat_max: float
+        :type lat_max: :class:`float`
 
         :param lon_min: The minimum longitude bound.
-        :type lon_min: float
+        :type lon_min: :class:`float`
         
         :param lon_max: The maximum longitude bound.
-        :type lon_max: float
+        :type lon_max: :class:`float`
 
         :param start: The starting datetime bound.
-        :type start: datetime
+        :type start: :class:`datetime.datetime`
 
         :param end: The ending datetime bound.
-        :type end: datetime
+        :type end: :class:`datetime.datetime`
 
         :raises: ValueError
         '''


[03/21] climate git commit: CLIMATE-372 - Add custom names to dap data source

Posted by jo...@apache.org.
CLIMATE-372 - Add custom names to dap data source


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

Branch: refs/heads/master
Commit: 79fa8a60d0770bb2dcada6974b9ed5806fdbfbdc
Parents: f6f1dd6
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 09:21:44 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 09:21:44 2014 -0800

----------------------------------------------------------------------
 ocw/data_source/dap.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/79fa8a60/ocw/data_source/dap.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/dap.py b/ocw/data_source/dap.py
index a4c413b..b188cb5 100644
--- a/ocw/data_source/dap.py
+++ b/ocw/data_source/dap.py
@@ -21,13 +21,15 @@ import requests
 import numpy as np
 from ocw.dataset import Dataset
 
-def load(url, variable):
+def load(url, variable, name=''):
     '''Load a Dataset from an OpenDAP URL
 
     :param url: The OpenDAP URL for the dataset of interest.
     :type url: String
     :param variable: The name of the variable to read from the dataset.
     :type variable: String
+    :param name: (Optional) A name for the loaded dataset.
+    :type name: String
 
     :returns: A Dataset object containing the dataset pointed to by the 
         OpenDAP URL.
@@ -55,7 +57,7 @@ def load(url, variable):
     lons = np.array(dataset[lon][:])
     values = np.array(dataset[:])
 
-    return Dataset(lats, lons, times, values, variable)
+    return Dataset(lats, lons, times, values, variable, name=name)
 
 def _convert_times_to_datetime(time):
     '''Convert the OpenDAP time object's values to datetime objects


[07/21] climate git commit: CLIMATE-372 - Testing custom RCMED dataset naming

Posted by jo...@apache.org.
CLIMATE-372 - Testing custom RCMED dataset naming


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

Branch: refs/heads/master
Commit: 197530e7c4d8832acb68f79eb365ed3748aeaf18
Parents: a600a04
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 09:35:04 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 09:35:04 2014 -0800

----------------------------------------------------------------------
 ocw/tests/test_rcmed.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/197530e7/ocw/tests/test_rcmed.py
----------------------------------------------------------------------
diff --git a/ocw/tests/test_rcmed.py b/ocw/tests/test_rcmed.py
index db354ca..6c882f4 100644
--- a/ocw/tests/test_rcmed.py
+++ b/ocw/tests/test_rcmed.py
@@ -100,8 +100,13 @@ class test_rcmed(unittest.TestCase, CustomAssertions):
 
     def test_function_parameter_dataset_values(self):
         rcmed.urllib2.urlopen = self.return_text
-        self.assert1DArraysEqual(rcmed.parameter_dataset(self.dataset_id, self.parameter_id, self.min_lat, self.max_lat, self.min_lon, self.max_lon, self.start_time, self.end_time).values.flatten(), self.values.flatten())
+        self.assert1DArraysEqual(rcmed.parameter_dataset(self.dataset_id, self.parameter_id, self.min_lat, self.max_lat, self.min_lon, self.max_lon, self.start_tnamime, self.end_time).values.flatten(), self.values.flatten())
 
 
+    def test_function_parameter_dataset_values(self):
+        rcmed.urllib2.urlopen = self.return_text
+        ds = rcmed.parameter_dataset(self.dataset_id, self.parameter_id, self.min_lat, self.max_lat, self.min_lon, self.max_lon, self.start_time, self.end_time, name='foo')
+        self.assertEquals(ds.name, 'foo')
+
 if __name__ == '__main__':
     unittest.main()


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

Posted by jo...@apache.org.
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


[13/21] climate git commit: CLIMATE-558 - Update Plotting module documentation links

Posted by jo...@apache.org.
CLIMATE-558 - Update Plotting module documentation links


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

Branch: refs/heads/master
Commit: 65db77f0aea735b3af0cff815f2e3724d4e0bfb8
Parents: 7aa55b6
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 12:23:42 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 12:23:42 2014 -0800

----------------------------------------------------------------------
 ocw/plotter.py | 275 +++++++++++++++++++++++++++++++---------------------
 1 file changed, 167 insertions(+), 108 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/65db77f0/ocw/plotter.py
----------------------------------------------------------------------
diff --git a/ocw/plotter.py b/ocw/plotter.py
index 45c560a..337cfd3 100644
--- a/ocw/plotter.py
+++ b/ocw/plotter.py
@@ -36,7 +36,7 @@ def set_cmap(name):
     version of it.
 
     :param name: The name of the colormap.
-    :type name: str
+    :type name: :mod:`string`
     '''
     # The first line is redundant but it prevents the user from setting
     # the cmap rc value improperly
@@ -156,33 +156,43 @@ def draw_taylor_diagram(results, names, refname, fname, fmt='png',
 
     :param results: An Nx2 array containing normalized standard deviations,
        correlation coefficients, and names of evaluation results.
-    :type results: Numpy Array
+    :type results: :class:`numpy.ndarray`
+
     :param names: A list of names for each evaluated dataset
-    :type names: List of strings
+    :type names: :class:`list` of :mod:`string`
+
     :param refname: The name of the reference dataset.
-    :type refname: string
+    :type refname: :mod:`string`
+
     :param fname: The filename of the plot.
-    :type fname: string
-    :param fmt: Optional filetype for the output plot.
-    :type fmt: string
-    :param gridshape: Optional tuple denoting the desired grid shape
+    :type fname: :mod:`string`
+
+    :param fmt: (Optional) filetype for the output plot.
+    :type fmt: :mod:`string`
+
+    :param gridshape: (Optional) Tuple denoting the desired grid shape
         (num_rows, num_cols) for arranging the subplots.
-    :type gridshape: Tuple (num_rows, num_cols)
-    :param ptitle: Optional plot title.
-    :type ptitle: string
-    :param subtitles: Optional list of strings specifying the title for each
+    :type gridshape: A :class:`tuple` of the form (num_rows, num_cols)
+
+    :param ptitle: (Optional) plot title.
+    :type ptitle: :mod:`string`
+    
+    :param subtitles: (Optional) list of strings specifying the title for each
         subplot.
-    :type subtitles: List of strings
-    :param pos: Optional string or tuple of floats used to set the position
+    :type subtitles: :class:`list` of :mod:`string`
+
+    :param pos: (Optional) string or tuple of floats used to set the position
         of the legend. Check the `Matplotlib docs <http://matplotlib.org/api/legend_api.html#matplotlib.legend.Legend>`_
         for additional information.
-    :type pos: string or tuple of floats
-    :param frameon: Optional boolean specifying whether to draw a frame
+    :type pos: :mod:`string` or :func:`tuple` of :class:`float`
+
+    :param frameon: (Optional) boolean specifying whether to draw a frame
         around the legend box.
-    :type frameon: boolean
-    :param radmax: Optional float to adjust the extent of the axes in terms of
+    :type frameon: :class:`bool`
+
+    :param radmax: (Optional) float to adjust the extent of the axes in terms of
         standard deviation.
-    :type radmax: float
+    :type radmax: :class:`float`
     '''
     # Handle the single plot case.
     if results.ndim == 2:
@@ -228,29 +238,37 @@ def draw_subregions(subregions, lats, lons, fname, fmt='png', ptitle='',
     ''' Draw subregion domain(s) on a map.
 
     :param subregions: The subregion objects to plot on the map.
-    :type subregions: List of subregion objects
+    :type subregions: :class:`list` of subregion objects
+
     :param lats: Array of latitudes values.
-    :type lats: Numpy Array
+    :type lats: :class:`numpy.ndarray`
+
     :param lons: Array of longitudes values.
-    :type lons: Numpy Array
+    :type lons: :class:`numpy.ndarray`
+
     :param fname: The filename of the plot.
-    :type fname: string
-    :param fmt: Optional filetype for the output.
-    :type fmt: string
-    :param ptitle: Optional plot title.
-    :type ptitle: string
-    :param parallels: Optional list of ints or floats for the parallels to
+    :type fname: :mod:`string`
+
+    :param fmt: (Optional) filetype for the output.
+    :type fmt: :mod:`string`
+
+    :param ptitle: (Optional) plot title.
+    :type ptitle: :mod:`string`
+
+    :param parallels: (Optional) :class:`list` of :class:`int` or :class:`float` for the parallels to
         be drawn. See the `Basemap documentation <http://matplotlib.org/basemap/users/graticule.html>`_
         for additional information.
-    :type parallels: List of ints or floats
-    :param meridians: Optional list of ints or floats for the meridians to
+    :type parallels: :class:`list` of :class:`int` or :class:`float`
+
+    :param meridians: (Optional) :class:`list` of :class:`int` or :class:`float` for the meridians to
         be drawn. See the `Basemap documentation <http://matplotlib.org/basemap/users/graticule.html>`_
         for additional information.
-    :type meridians: List of ints or floats
-    :param subregion_masks: Optional dictionary of boolean arrays for each
+    :type meridians: :class:`list` of :class:`int` or :class:`float`
+
+    :param subregion_masks: (Optional) :class:`dict` of :class:`bool` arrays for each
         subregion for giving finer control of the domain to be drawn, by default
         the entire domain is drawn.
-    :type subregion_masks: Dictionary of boolean arrays
+    :type subregion_masks: :class:`dict` of :class:`bool` arrays
     '''
     # Set up the figure
     fig = plt.figure()
@@ -333,36 +351,48 @@ def draw_time_series(results, times, labels, fname, fmt='png', gridshape=(1, 1),
     ''' Draw a time series plot.
 
     :param results: 3D array of time series data.
-    :type results: Numpy Array
+    :type results: :class:`numpy.ndarray`
+
     :param times: List of Python datetime objects used by Matplotlib to handle
         axis formatting.
-    :type times: List of datetime objects
+    :type times: :class:`list` of :class:`datetime.datetime`
+
     :param labels: List of names for each data being plotted.
-    :type labels: List of string
+    :type labels: :class:`list` of :mod:`string`
+
     :param fname: Filename of the plot.
-    :type fname: string
-    :param fmt: Optional filetype for the output.
-    :type fmt: string
-    :param gridshape: Optional tuple denoting the desired grid shape
+    :type fname: :mod:`string`
+
+    :param fmt: (Optional) filetype for the output.
+    :type fmt: :mod:`string`
+
+    :param gridshape: (Optional) tuple denoting the desired grid shape
         (num_rows, num_cols) for arranging the subplots.
-    :type gridshape: Tuple (num_rows, num_cols)
-    :param xlabel: Optional x-axis title.
-    :type xlabel: string
-    :param ylabel: Optional y-ayis title.
-    :type ylabel: string
-    :param ptitle: Optional plot title.
-    :type ptitle: string
-    :param subtitles: Optional list of titles for each subplot.
-    :type subtitles: List of strings
-    :param label_month: Optional flag to toggle drawing month labels on the
+    :type gridshape: :func:`tuple` of the form (num_rows, num_cols)
+
+    :param xlabel: (Optional) x-axis title.
+    :type xlabel: :mod:`string`
+    
+    :param ylabel: (Optional) y-ayis title.
+    :type ylabel: :mod:`string`
+
+    :param ptitle: (Optional) plot title.
+    :type ptitle: :mod:`string`
+
+    :param subtitles: (Optional) list of titles for each subplot.
+    :type subtitles: :class:`list` of :mod:`string`
+    
+    :param label_month: (Optional) flag to toggle drawing month labels on the
         x-axis.
-    :type label_month: boolean
-    :param yscale: Optional y-axis scale value, 'linear' for linear and 'log'
+    :type label_month: :class:`bool`
+
+    :param yscale: (Optional) y-axis scale value, 'linear' for linear and 'log'
         for log base 10.
-    :type yscale: string
-    :param aspect: Optional approximate aspect ratio of each subplot
+    :type yscale: :mod:`string`
+    
+    :param aspect: (Optional) approximate aspect ratio of each subplot
         (width / height). Default is 8.5 / 5.5
-    :type aspect: float
+    :type aspect: :class:`float`
     '''
     # Handle the single plot case.
     if results.ndim == 2:
@@ -465,44 +495,58 @@ def draw_contour_map(dataset, lats, lons, fname, fmt='png', gridshape=(1, 1),
     ''' Draw a multiple panel contour map plot.
 
     :param dataset: 3D array of data to be plotted with shape (nT, nLon, nLat).
-    :type dataset: Numpy Array
+    :type dataset: :class:`numpy.ndarray`
+
     :param lats: Array of latitudes values.
-    :type lats: Numpy Array
+    :type lats: :class:`numpy.ndarray`
+
     :param lons: Array of longitudes
-    :type lons: Numpy Array
+    :type lons: :class:`numpy.ndarray`
+
     :param fname: The filename of the plot.
-    :type fname: string
-    :param fmt: Optional filetype for the output.
-    :type fmt: string
-    :param gridshape: Optional tuple denoting the desired grid shape
+    :type fname: :mod:`string`
+
+    :param fmt: (Optional) filetype for the output.
+    :type fmt: :mod:`string`
+
+    :param gridshape: (Optional) tuple denoting the desired grid shape
         (num_rows, num_cols) for arranging the subplots.
-    :type gridshape: Tuple (num_rows, num_cols)
-    :param clabel: Optional colorbar title.
-    :type clabel: string
-    :param ptitle: Optional plot title.
-    :type ptitle: string
-    :param subtitles: Optional list of titles for each subplot.
-    :type subtitles: List of strings
-    :param cmap: Optional string or matplotlib.colors.LinearSegmentedColormap
+    :type gridshape: :func:`tuple` of the form (num_rows, num_cols)
+
+    :param clabel: (Optional) colorbar title.
+    :type clabel: :mod:`string`
+
+    :param ptitle: (Optional) plot title.
+    :type ptitle: :mod:`string`
+
+    :param subtitles: (Optional) list of titles for each subplot.
+    :type subtitles: :class:`list` of :mod:`string`
+
+    :param cmap: (Optional) string or :class:`matplotlib.colors.LinearSegmentedColormap`
         instance denoting the colormap. This must be able to be recognized by
         `Matplotlib's get_cmap function <http://matplotlib.org/api/cm_api.html#matplotlib.cm.get_cmap>`_.
-    :type cmap: string or LinearSegmentedColormap object
-    :param clevs: Optional contour levels values.
-    :type clevs: List of ints or floats
-    :param nlevs: Optional target number of contour levels if clevs is None.
-    :type nlevs: int
-    :param parallels: Optional list of ints or floats for the parallels to
+    :type cmap: :mod:`string` or :class:`matplotlib.colors.LinearSegmentedColormap`
+
+    :param clevs: (Optional) contour levels values.
+    :type clevs: :class:`list` of :class:`int` or :class:`float`
+    
+    :param nlevs: (Optional) target number of contour levels if clevs is None.
+    :type nlevs: :class:`int`
+
+    :param parallels: (Optional) list of ints or floats for the parallels to
         be drawn. See the `Basemap documentation <http://matplotlib.org/basemap/users/graticule.html>`_
         for additional information.
-    :type parallels: List of ints or floats
-    :param meridians: Optional list of ints or floats for the meridians to
+    :type parallels: :class:`list` of :class:`int` or :class:`float`
+
+    :param meridians: (Optional) list of ints or floats for the meridians to
         be drawn. See the `Basemap documentation <http://matplotlib.org/basemap/users/graticule.html>`_
         for additional information.
-    :type meridians: List of ints or floats
-    :param extend: Optional flag to toggle whether to place arrows at the colorbar
+    :type meridians: :class:`list` of :class:`int` or :class:`float`
+
+    :param extend: (Optional) flag to toggle whether to place arrows at the colorbar
          boundaries. Default is 'neither', but can also be 'min', 'max', or
          'both'. Will be automatically set to 'both' if clevs is None.
-    :type extend: string
+    :type extend: :mod:`string`
     '''
     # Handle the single plot case. Meridians and Parallels are not labeled for
     # multiple plots to save space.
@@ -627,43 +671,58 @@ def draw_portrait_diagram(results, rowlabels, collabels, fname, fmt='png',
     :param results: 3D array of the fields to be plotted. The second dimension
               should correspond to the number of rows in the diagram and the
               third should correspond to the number of columns.
-    :type results: Numpy Array
+    :type results: :class:`numpy.ndarray`
+
     :param rowlabels: Labels for each row.
-    :type rowlabels: List of strings
+    :type rowlabels: :class:`list` of :mod:`string`
+
     :param collabels: Labels for each row.
-    :type collabels: List of strings
+    :type collabels: :class:`list` of :mod:`string`
+
     :param fname: Filename of the plot.
-    :type fname: string
-    :param fmt: Optional filetype for the output.
-    :type fmt: string
-    :param gridshape: Optional tuple denoting the desired grid shape
+    :type fname: :mod:`string`
+    
+    :param fmt: (Optional) filetype for the output.
+    :type fmt: :mod:`string`
+
+    :param gridshape: (Optional) tuple denoting the desired grid shape
         (num_rows, num_cols) for arranging the subplots.
-    :type gridshape: Tuple (num_rows, num_cols)
-    :param xlabel: Optional x-axis title.
-    :type xlabel: string
-    :param ylabel: Optional y-ayis title.
-    :type ylabel: string
-    :param clabel: Optional colorbar title.
-    :type clabel: string
-    :param ptitle: Optional plot title.
-    :type ptitle: string
-    :param subtitles: Optional list of titles for each subplot.
-    :type subtitles: List of strings
-    :param cmap: Optional string or matplotlib.colors.LinearSegmentedColormap
+    :type gridshape: :func:`tuple` of the form (num_rows, num_cols)
+
+    :param xlabel: (Optional) x-axis title.
+    :type xlabel: :mod:`string`
+
+    :param ylabel: (Optional) y-ayis title.
+    :type ylabel: :mod:`string`
+
+    :param clabel: (Optional) colorbar title.
+    :type clabel: :mod:`string`
+
+    :param ptitle: (Optional) plot title.
+    :type ptitle: :mod:`string`
+
+    :param subtitles: (Optional) list of titles for each subplot.
+    :type subtitles: :class:`list` of :mod:`string`
+
+    :param cmap: (Optional) string or :class:`matplotlib.colors.LinearSegmentedColormap`
         instance denoting the colormap. This must be able to be recognized by
         `Matplotlib's get_cmap function <http://matplotlib.org/api/cm_api.html#matplotlib.cm.get_cmap>`_.
-    :type cmap: string or LinearSegmentedColormap object
-    :param clevs: Optional contour levels values.
-    :type clevs: List of ints or floats
+    :type cmap: :mod:`string` or :class:`matplotlib.colors.LinearSegmentedColormap`
+
+    :param clevs: (Optional) contour levels values.
+    :type clevs: :class:`list` of :class:`int` or :class:`float`
+
     :param nlevs: Optional target number of contour levels if clevs is None.
-    :type nlevs: int
-    :param extend: Optional flag to toggle whether to place arrows at the colorbar
+    :type nlevs: :class:`int`
+
+    :param extend: (Optional) flag to toggle whether to place arrows at the colorbar
          boundaries. Default is 'neither', but can also be 'min', 'max', or
          'both'. Will be automatically set to 'both' if clevs is None.
-    :type extend: string
-    :param aspect: Optional approximate aspect ratio of each subplot
+    :type extend: :mod:`string`
+
+    :param aspect: (Optional) approximate aspect ratio of each subplot
         (width / height). Default is 8.5 / 5.5
-    :type aspect: float
+    :type aspect: :class:`float`
     '''
     # Handle the single plot case.
     if results.ndim == 2:


[12/21] climate git commit: CLIMATE-558 - Update metrics module documentation links

Posted by jo...@apache.org.
CLIMATE-558 - Update metrics module documentation links


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

Branch: refs/heads/master
Commit: 7aa55b66485cfbb7e234533213d3a9fa0080c3b5
Parents: ed67393
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 11:33:09 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 11:33:09 2014 -0800

----------------------------------------------------------------------
 ocw/metrics.py | 48 ++++++++++++++++++++++++++++--------------------
 1 file changed, 28 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/7aa55b66/ocw/metrics.py
----------------------------------------------------------------------
diff --git a/ocw/metrics.py b/ocw/metrics.py
index 5c99e3e..855d4e3 100644
--- a/ocw/metrics.py
+++ b/ocw/metrics.py
@@ -40,7 +40,7 @@ class UnaryMetric(Metric):
 
         :param target_dataset: The dataset on which the current metric will
             be run.
-        :type target_dataset: ocw.dataset.Dataset object
+        :type target_dataset: :class:`dataset.Dataset`
 
         :returns: The result of evaluating the metric on the target_dataset.
         '''
@@ -56,10 +56,11 @@ class BinaryMetric(Metric):
 
         :param ref_dataset: The Dataset to use as the reference dataset when
             running the evaluation.
-        :type ref_dataset: ocw.dataset.Dataset object
+        :type ref_dataset: :class:`dataset.Dataset`
+
         :param target_dataset: The Dataset to use as the target dataset when
             running the evaluation.
-        :type target_dataset: ocw.dataset.Dataset object
+        :type target_dataset: :class:`dataset.Dataset`
 
         :returns: The result of evaluation the metric on the reference and 
             target dataset.
@@ -76,13 +77,14 @@ class Bias(BinaryMetric):
            Overrides BinaryMetric.run()
 
         :param ref_dataset: The reference dataset to use in this metric run.
-        :type ref_dataset: ocw.dataset.Dataset object
+        :type ref_dataset: :class:`dataset.Dataset`
+
         :param target_dataset: The target dataset to evaluate against the
             reference dataset in this metric run.
-        :type target_dataset: ocw.dataset.Dataset object
+        :type target_dataset: :class:`dataset.Dataset`
 
         :returns: The difference between the reference and target datasets.
-        :rtype: Numpy Array
+        :rtype: :class:`numpy.ndarray`
         '''
         return ref_dataset.values - target_dataset.values
 
@@ -98,10 +100,10 @@ class TemporalStdDev(UnaryMetric):
 
         :param target_dataset: The target_dataset on which to calculate the 
             temporal standard deviation.
-        :type target_dataset: ocw.dataset.Dataset object
+        :type target_dataset: :class:`dataset.Dataset`
 
         :returns: The temporal standard deviation of the target dataset
-        :rtype: Numpy Array
+        :rtype: :class:`ndarray`
         '''
         return target_dataset.values.std(axis=0, ddof=1)
 
@@ -116,10 +118,11 @@ class StdDevRatio(BinaryMetric):
             Overrides BinaryMetric.run()
 
         :param ref_dataset: The reference dataset to use in this metric run.
-        :type ref_dataset: ocw.dataset.Dataset object
+        :type ref_dataset: :class:`dataset.Dataset`
+
         :param target_dataset: The target dataset to evaluate against the
             reference dataset in this metric run.
-        :type target_dataset: ocw.dataset.Dataset object
+        :type target_dataset: :class:`dataset.Dataset`
 
         :returns: The standard deviation ratio of the reference and target
         '''
@@ -136,10 +139,11 @@ class PatternCorrelation(BinaryMetric):
            Overrides BinaryMetric.run()
 
         :param ref_dataset: The reference dataset to use in this metric run.
-        :type ref_dataset: ocw.dataset.Dataset object
+        :type ref_dataset: :class:`dataset.Dataset`
+
         :param target_dataset: The target dataset to evaluate against the
             reference dataset in this metric run.
-        :type target_dataset: ocw.dataset.Dataset object
+        :type target_dataset: :class:`dataset.Dataset`
 
         :returns: The correlation coefficient between a reference and target dataset.
         '''
@@ -162,10 +166,11 @@ class TemporalCorrelation(BinaryMetric):
 
         :param reference_dataset: The reference dataset to use in this metric
             run
-        :type reference_dataset: ocw.dataset.Dataset object
+        :type reference_dataset: :class:`dataset.Dataset`
+
         :param target_dataset: The target dataset to evaluate against the
             reference dataset in this metric run
-        :type target_dataset: ocw.dataset.Dataset object
+        :type target_dataset: :class:`dataset.Dataset`
 
         :returns: A 2D array of temporal correlation coefficients and a 2D
             array of confidence levels associated with the temporal correlation
@@ -196,10 +201,11 @@ class TemporalMeanBias(BinaryMetric):
            Overrides BinaryMetric.run()
 
         :param ref_dataset: The reference dataset to use in this metric run.
-        :type ref_dataset: ocw.dataset.Dataset object
+        :type ref_dataset: :class:`dataset.Dataset`
+
         :param target_dataset: The target dataset to evaluate against the
             reference dataset in this metric run.
-        :type target_dataset: ocw.dataset.Dataset object
+        :type target_dataset: :class:`dataset.Dataset`
 
         :returns: The mean bias between a reference and target dataset over time.
         '''
@@ -223,10 +229,11 @@ class SpatialMeanOfTemporalMeanBias(BinaryMetric):
 
         :param reference_dataset: The reference dataset to use in this metric
             run
-        :type reference_dataset: ocw.dataset.Dataset object
+        :type reference_dataset: :class:`dataset.Dataset`
+
         :param target_dataset: The target dataset to evaluate against the
             reference dataset in this metric run
-        :type target_dataset: ocw.dataset.Dataset object
+        :type target_dataset: :class:`dataset.Dataset`
 
         :returns: The bias averaged over time and domain
         '''
@@ -248,10 +255,11 @@ class RMSError(BinaryMetric):
 
         :param reference_dataset: The reference dataset to use in this metric
             run
-        :type reference_dataset: ocw.dataset.Dataset object
+        :type reference_dataset: :class:`dataset.Dataset`
+
         :param target_dataset: The target dataset to evaluate against the
             reference dataset in this metric run
-        :type target_dataset: ocw.dataset.Dataset object
+        :type target_dataset: :class:`dataset.Dataset`
 
         :returns: The RMS error, with the mean calculated over time and space
         '''


[10/21] climate git commit: CLIMATE-558 - Update dataset_processor module documentation links

Posted by jo...@apache.org.
CLIMATE-558 - Update dataset_processor module documentation links


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

Branch: refs/heads/master
Commit: ac417f8b723bf95b171c830879e1a56d6b2fb72d
Parents: cdf6c13
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 10:57:25 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 10:57:25 2014 -0800

----------------------------------------------------------------------
 ocw/dataset_processor.py | 47 +++++++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/ac417f8b/ocw/dataset_processor.py
----------------------------------------------------------------------
diff --git a/ocw/dataset_processor.py b/ocw/dataset_processor.py
index 15d574c..37296f2 100644
--- a/ocw/dataset_processor.py
+++ b/ocw/dataset_processor.py
@@ -33,12 +33,13 @@ def temporal_rebin(target_dataset, temporal_resolution):
     """ Rebin a Dataset to a new temporal resolution
     
     :param target_dataset: Dataset object that needs temporal rebinned
-    :type target_dataset: ocw.dataset.Dataset object
+    :type target_dataset: :class:`dataset.Dataset`
+
     :param temporal_resolution: The new temporal bin size
-    :type temporal_resolution: datetime.timedelta object
+    :type temporal_resolution: :class:`datetime.timedelta`
     
     :returns: A new temporally rebinned Dataset
-    :rtype: ocw.dataset.Dataset object
+    :rtype: :class:`dataset.Dataset`
     """
     # Decode the temporal resolution into a string format that 
     # _rcmes_calc_average_on_new_time_unit_K() can understand
@@ -69,14 +70,16 @@ def spatial_regrid(target_dataset, new_latitudes, new_longitudes):
     """ Regrid a Dataset using the new latitudes and longitudes
 
     :param target_dataset: Dataset object that needs spatially regridded
-    :type target_dataset: ocw.dataset.Dataset object
+    :type target_dataset: :class:`dataset.Dataset`
+
     :param new_latitudes: Array of latitudes
-    :type new_latitudes: 1d Numpy Array
+    :type new_latitudes: :class:`numpy.ndarray`
+
     :param new_longitudes: Array of longitudes
-    :type new_longitudes: 1d Numpy Array
+    :type new_longitudes: :class:`numpy.ndarray`
 
     :returns: A new spatially regridded Dataset
-    :rtype: ocw.dataset.Dataset object
+    :rtype: :class:`dataset.Dataset`
     """
     # Make masked array of shape (times, new_latitudes,new_longitudes)
     new_values = ma.zeros([len(target_dataset.times), 
@@ -123,10 +126,10 @@ def ensemble(datasets):
     
     :param datasets: Datasets to be used to compose the ensemble dataset from.
         All Datasets must be the same shape.
-    :type datasets: List of OCW Dataset Objects.
+    :type datasets: :class:`list` of :class:`dataset.Dataset`
     
     :returns: New Dataset with a name of 'Dataset Ensemble'
-    :rtype: ocw.dataset.Dataset object
+    :rtype: :class:`dataset.Dataset`
     """
     _check_dataset_shapes(datasets)
     dataset_values = [dataset.values for dataset in datasets]
@@ -145,12 +148,13 @@ def subset(subregion, target_dataset):
     '''Subset given dataset(s) with subregion information
 
     :param subregion: The Bounds with which to subset the target Dataset. 
-    :type subregion: Bounds
+    :type subregion: :class:`dataset.Bounds`
+
     :param target_dataset: The Dataset object to subset.
-    :type target_dataset: ocw.dataset.Dataset object
+    :type target_dataset: :class:`dataset.Dataset`
 
     :returns: The subset-ed Dataset object
-    :rtype: ocw.dataset.Dataset object
+    :rtype: :class:`dataset.Dataset`
 
     :raises: ValueError
     '''
@@ -189,12 +193,13 @@ def safe_subset(subregion, target_dataset):
     subregion and dataset without returning an error.
 
     :param subregion: The Bounds with which to subset the target Dataset.
-    :type subregion: ocw.dataset.Bounds
+    :type subregion: :class:`dataset.Bounds`
+
     :param target_dataset: The Dataset object to subset.
-    :type target_dataset: ocw.dataset.Dataset
+    :type target_dataset: :class:`dataset.Dataset`
 
     :returns: The subset-ed Dataset object
-    :rtype: ocw.dataset.Dataset object
+    :rtype: :class:`dataset.Dataset`
     '''
 
     lat_min, lat_max, lon_min, lon_max = target_dataset.spatial_boundaries()
@@ -227,13 +232,14 @@ def normalize_dataset_datetimes(dataset, timestep):
     Force monthly data to the first of the month at midnight.
 
     :param dataset: The Dataset which will have its time value normalized.
-    :type dataset: ocw.dataset.Dataset object
+    :type dataset: :class:`dataset.Dataset`
+
     :param timestep: The timestep of the Dataset's values. Either 'daily' or
         'monthly'.
-    :type timestep: String
+    :type timestep: :mod:`string`
 
     :returns: A new Dataset with normalized datetime values.
-    :rtype: ocw.dataset.Dataset object
+    :rtype: :class:`dataset.Dataset`
     '''
     new_times = _rcmes_normalize_datetimes(dataset.times, timestep)
     return ds.Dataset(
@@ -249,10 +255,10 @@ def write_netcdf(dataset, path, compress=True):
     ''' Write a dataset to a NetCDF file.
 
     :param dataset: The dataset to write.
-    :type dataset: ocw.dataset.Dataset
+    :type dataset: :class:`dataset.Dataset`
 
     :param path: The output file path.
-    :type path: string
+    :type path: :mod:`string`
     '''
     out_file = netCDF4.Dataset(path, 'w', format='NETCDF4')
 
@@ -300,6 +306,7 @@ def _rcmes_normalize_datetimes(datetimes, timestep):
 
     :param datetimes: The datetimes to normalize.
     :type datetimes: List of `datetime` values.
+
     :param timestep: The flag for how to normalize the datetimes.
     :type timestep: String
     """


[14/21] climate git commit: CLIMATE-588 - Add utils to Sphinx build

Posted by jo...@apache.org.
CLIMATE-588 - Add utils to Sphinx build


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

Branch: refs/heads/master
Commit: 33a52ea3039ccfbe7a24d74b2f02316d34685c53
Parents: 65db77f
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 12:37:58 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 12:37:58 2014 -0800

----------------------------------------------------------------------
 docs/source/index.rst     | 1 +
 docs/source/ocw/utils.rst | 5 +++++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/33a52ea3/docs/source/index.rst
----------------------------------------------------------------------
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 52cee23..796e8da 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -17,6 +17,7 @@ Contents:
    ocw/evaluation
    ocw/metrics
    ocw/plotter
+   ocw/utils
    data_source/data_sources
    ui-backend/backend.rst
 

http://git-wip-us.apache.org/repos/asf/climate/blob/33a52ea3/docs/source/ocw/utils.rst
----------------------------------------------------------------------
diff --git a/docs/source/ocw/utils.rst b/docs/source/ocw/utils.rst
new file mode 100644
index 0000000..0dc5354
--- /dev/null
+++ b/docs/source/ocw/utils.rst
@@ -0,0 +1,5 @@
+Utils Module
+************
+
+.. automodule:: utils
+   :members:


[21/21] climate git commit: Resolve CLIMATE-558. Merge PR #139.

Posted by jo...@apache.org.
Resolve CLIMATE-558. Merge PR #139.


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

Branch: refs/heads/master
Commit: 1adafc13660c885d477fc9c90022522e642478a8
Parents: a5c394e 95f0943
Author: Michael Joyce <jo...@apache.org>
Authored: Wed Nov 19 08:52:26 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Wed Nov 19 08:52:26 2014 -0800

----------------------------------------------------------------------
 docs/source/conf.py       |   5 +-
 docs/source/index.rst     |   1 +
 docs/source/ocw/utils.rst |   5 +
 ocw/data_source/dap.py    |  12 +-
 ocw/data_source/esgf.py   |  26 ++--
 ocw/data_source/local.py  |  22 ++--
 ocw/data_source/rcmed.py  |  30 +++--
 ocw/dataset.py            |  39 +++---
 ocw/dataset_processor.py  |  47 ++++---
 ocw/evaluation.py         |  19 +--
 ocw/metrics.py            |  48 ++++---
 ocw/plotter.py            | 275 +++++++++++++++++++++++++----------------
 ocw/utils.py              |  36 +++---
 13 files changed, 342 insertions(+), 223 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/1adafc13/ocw/data_source/dap.py
----------------------------------------------------------------------
diff --cc ocw/data_source/dap.py
index b188cb5,1d6a494..3694410
--- a/ocw/data_source/dap.py
+++ b/ocw/data_source/dap.py
@@@ -25,14 -25,13 +25,16 @@@ def load(url, variable, name='')
      '''Load a Dataset from an OpenDAP URL
  
      :param url: The OpenDAP URL for the dataset of interest.
-     :type url: String
+     :type url: :mod:`string`
+ 
      :param variable: The name of the variable to read from the dataset.
-     :type variable: String
+     :type variable: :mod:`string`
+ 
 +    :param name: (Optional) A name for the loaded dataset.
-     :type name: String
++    :type name: :mod:`string`
 +
-     :returns: A Dataset object containing the dataset pointed to by the 
-         OpenDAP URL.
+     :returns: A :class:`dataset.Dataset` containing the dataset pointed to by
+         the OpenDAP URL.
  
      :raises: ServerError
      '''

http://git-wip-us.apache.org/repos/asf/climate/blob/1adafc13/ocw/data_source/esgf.py
----------------------------------------------------------------------
diff --cc ocw/data_source/esgf.py
index 11eb138,1e8038d..c5ed03a
--- a/ocw/data_source/esgf.py
+++ b/ocw/data_source/esgf.py
@@@ -39,20 -38,25 +39,28 @@@ def load_dataset(dataset_id
      ''' Load an ESGF dataset.
  
      :param dataset_id: The ESGF ID of the dataset to load.
-     :type dataset_id: String
+     :type dataset_id: :mod:`string`
+ 
      :param variable: The variable to load.
-     :type variable: String
+     :type variable: :mod:`string`
+ 
      :param esgf_username: ESGF OpenID value to use for authentication.
-     :type esgf_username: String
+     :type esgf_username: :mod:`string`
+ 
      :param esgf_password: ESGF Password to use for authentication.
-     :type esgf_password: String
+     :type esgf_password: :mod:`string`
+ 
      :param search_url: (Optional) The ESGF node to use for searching. Defaults
          to the Jet Propulsion Laboratory node.
-     :type search_url: String
+     :type search_url: :mod:`string`
+ 
      :param elevation_index: (Optional) The elevation level to strip out when
          loading the dataset using ocw.data_source.local.
+     :type elevation_index: :class:`int`
+ 
 +    :param name: (Optional) A name for the loaded dataset.
-     :type name: String
++    :type name: :mod:`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.

http://git-wip-us.apache.org/repos/asf/climate/blob/1adafc13/ocw/data_source/local.py
----------------------------------------------------------------------
diff --cc ocw/data_source/local.py
index 5fd0571,ae6c286..c6405a9
--- a/ocw/data_source/local.py
+++ b/ocw/data_source/local.py
@@@ -128,18 -129,19 +130,22 @@@ def load_file(file_path
          expects 3D data so a single layer needs to be stripped out when loading.
          By default, the first elevation layer is used. If desired you may
          specify the elevation value to use.
-     :type elevation_index: Integer
+     :type elevation_index: :class:`int`
+ 
 +    :param name: (Optional) A name for the loaded dataset.
-     :type name: String
++    :type name: :mod:`string`
++
      :param lat_name: (Optional) The latitude variable name to extract from the
          dataset.
-     :type lat_name: String
+     :type lat_name: :mod:`string`
+ 
      :param lon_name: (Optional) The longitude variable name to extract from the
          dataset.
-     :type lon_name: String
+     :type lon_name: :mod:`string`
+ 
      :param time_name: (Optional) The time variable name to extract from the
          dataset.
-     :type time_name: String
+     :type time_name: :mod:`string`
  
      :returns: An OCW Dataset object with the requested variable's data from
          the NetCDF file.

http://git-wip-us.apache.org/repos/asf/climate/blob/1adafc13/ocw/data_source/rcmed.py
----------------------------------------------------------------------
diff --cc ocw/data_source/rcmed.py
index 16cc21c,669556e..d184078
--- a/ocw/data_source/rcmed.py
+++ b/ocw/data_source/rcmed.py
@@@ -316,26 -316,31 +316,34 @@@ def parameter_dataset(dataset_id, param
      '''Get data from one database(parameter).
  
      :param dataset_id: Dataset id.
-     :type dataset_id: Integer
+     :type dataset_id: :class:`int`
+ 
      :param parameter_id: Parameter id
-     :type parameter_id: Integer
+     :type parameter_id: :class:`int`
+ 
      :param min_lat: Minimum latitude
-     :type min_lat: Float
+     :type min_lat: :class:`float`
+ 
      :param max_lat: Maximum latitude
-     :type max_lat: Float
+     :type max_lat: :class:`float`
+ 
      :param min_lon: Minimum longitude
-     :type min_lon: Float
+     :type min_lon: :class:`float`
+     
      :param max_lon: Maximum longitude
-     :type max_lon: Float
+     :type max_lon: :class:`float`
+ 
      :param start_time: Start time
-     :type start_time: Datetime
+     :type start_time: :class:`datetime.datetime`
+ 
      :param end_time: End time 
-     :type end_time: Datetime
+     :type end_time: :class:`datetime.datetime`
+ 
 +    :param name: (Optional) A name for the loaded dataset.
-     :type name: String
++    :type name: :mod:`string`
 +
      :returns: An OCW Dataset object contained the requested data from RCMED.
-     :rtype: ocw.dataset.Dataset object
+     :rtype: :class:`dataset.Dataset`
      '''
      
      parameters_metadata = get_parameters_metadata()


[18/21] climate git commit: CLIMATE-558 - Update local module documentation links

Posted by jo...@apache.org.
CLIMATE-558 - Update local module documentation links


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

Branch: refs/heads/master
Commit: e9b8ad8cebd23cd269dea7aeafda7736fbea37ba
Parents: ff85d6f
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 12:50:35 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 12:50:35 2014 -0800

----------------------------------------------------------------------
 ocw/data_source/local.py | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/e9b8ad8c/ocw/data_source/local.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/local.py b/ocw/data_source/local.py
index acd8b7d..ae6c286 100644
--- a/ocw/data_source/local.py
+++ b/ocw/data_source/local.py
@@ -118,29 +118,34 @@ def load_file(file_path,
     ''' Load a NetCDF file into a Dataset.
 
     :param file_path: Path to the NetCDF file to load.
-    :type file_path: String
+    :type file_path: :mod:`string`
+
     :param variable_name: The variable name to load from the NetCDF file.
-    :type variable_name: String
+    :type variable_name: :mod:`string`
+
     :param elevation_index: (Optional) The elevation index for which data should
         be returned. Climate data is often times 4 dimensional data. Some
         datasets will have readins at different height/elevation levels. OCW
         expects 3D data so a single layer needs to be stripped out when loading.
         By default, the first elevation layer is used. If desired you may
         specify the elevation value to use.
-    :type elevation_index: Integer
+    :type elevation_index: :class:`int`
+
     :param lat_name: (Optional) The latitude variable name to extract from the
         dataset.
-    :type lat_name: String
+    :type lat_name: :mod:`string`
+
     :param lon_name: (Optional) The longitude variable name to extract from the
         dataset.
-    :type lon_name: String
+    :type lon_name: :mod:`string`
+
     :param time_name: (Optional) The time variable name to extract from the
         dataset.
-    :type time_name: String
+    :type time_name: :mod:`string`
 
     :returns: An OCW Dataset object with the requested variable's data from
         the NetCDF file.
-    :rtype: ocw.dataset.Dataset object
+    :rtype: :class:`dataset.Dataset`
 
     :raises ValueError: When the specified file path cannot be loaded by ndfCDF4
         or when the lat/lon/time variable name cannot be determined


[08/21] climate git commit: CLIMATE-558 - Add config for external doc linking

Posted by jo...@apache.org.
CLIMATE-558 - Add config for external doc linking

- Add necessary configuration for linking to numpy, scipy, and
  matplotlib documentation.


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

Branch: refs/heads/master
Commit: 544fab016cb92e38790c7ceb8a73117b78dca1c7
Parents: d56dff1
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 10:22:53 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 10:22:53 2014 -0800

----------------------------------------------------------------------
 docs/source/conf.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/544fab01/docs/source/conf.py
----------------------------------------------------------------------
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 6caf0cc..9323133 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -260,7 +260,10 @@ texinfo_documents = [
 
 
 # Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'http://docs.python.org/': None}
+intersphinx_mapping = {'python': ('http://docs.python.org/2', None),
+                       'numpy': ('http://docs.scipy.org/doc/numpy/', None),
+                       'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None),
+                       'matplotlib': ('http://matplotlib.sourceforge.net/', None)}
 
 # Autodoc config
 #


[16/21] climate git commit: CLIMATE-558 - Update DAP module documentation links

Posted by jo...@apache.org.
CLIMATE-558 - Update DAP module documentation links


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

Branch: refs/heads/master
Commit: 016bd67d97c4983aa2e3b86919f284019197c6de
Parents: 619997e
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 12:50:13 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 12:50:13 2014 -0800

----------------------------------------------------------------------
 ocw/data_source/dap.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/016bd67d/ocw/data_source/dap.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/dap.py b/ocw/data_source/dap.py
index a4c413b..1d6a494 100644
--- a/ocw/data_source/dap.py
+++ b/ocw/data_source/dap.py
@@ -25,12 +25,13 @@ def load(url, variable):
     '''Load a Dataset from an OpenDAP URL
 
     :param url: The OpenDAP URL for the dataset of interest.
-    :type url: String
+    :type url: :mod:`string`
+
     :param variable: The name of the variable to read from the dataset.
-    :type variable: String
+    :type variable: :mod:`string`
 
-    :returns: A Dataset object containing the dataset pointed to by the 
-        OpenDAP URL.
+    :returns: A :class:`dataset.Dataset` containing the dataset pointed to by
+        the OpenDAP URL.
 
     :raises: ServerError
     '''


[19/21] climate git commit: CLIMATE-558 - Update RCMED module documentation links

Posted by jo...@apache.org.
CLIMATE-558 - Update RCMED module documentation links


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

Branch: refs/heads/master
Commit: 95f094374d992f019241f026c8855374429dbe05
Parents: e9b8ad8
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 12:50:48 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 12:50:48 2014 -0800

----------------------------------------------------------------------
 ocw/data_source/rcmed.py | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/95f09437/ocw/data_source/rcmed.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/rcmed.py b/ocw/data_source/rcmed.py
index 410bf48..669556e 100644
--- a/ocw/data_source/rcmed.py
+++ b/ocw/data_source/rcmed.py
@@ -37,7 +37,7 @@ def get_parameters_metadata():
     '''Get the metadata of all parameter from RCMED.
 
     :returns: Dictionary of information for each parameter stored in one list
-    :rtype: List of dictionaries
+    :rtype: :class:`list` of :class:`dict`
     '''
 
     param_info_list = []
@@ -316,24 +316,31 @@ def parameter_dataset(dataset_id, parameter_id, min_lat, max_lat, min_lon, max_l
     '''Get data from one database(parameter).
 
     :param dataset_id: Dataset id.
-    :type dataset_id: Integer
+    :type dataset_id: :class:`int`
+
     :param parameter_id: Parameter id
-    :type parameter_id: Integer
+    :type parameter_id: :class:`int`
+
     :param min_lat: Minimum latitude
-    :type min_lat: Float
+    :type min_lat: :class:`float`
+
     :param max_lat: Maximum latitude
-    :type max_lat: Float
+    :type max_lat: :class:`float`
+
     :param min_lon: Minimum longitude
-    :type min_lon: Float
+    :type min_lon: :class:`float`
+    
     :param max_lon: Maximum longitude
-    :type max_lon: Float
+    :type max_lon: :class:`float`
+
     :param start_time: Start time
-    :type start_time: Datetime
+    :type start_time: :class:`datetime.datetime`
+
     :param end_time: End time 
-    :type end_time: Datetime
+    :type end_time: :class:`datetime.datetime`
 
     :returns: An OCW Dataset object contained the requested data from RCMED.
-    :rtype: ocw.dataset.Dataset object
+    :rtype: :class:`dataset.Dataset`
     '''
     
     parameters_metadata = get_parameters_metadata()