climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1514725 - /incubator/climate/branches/RefactorInput/ocw/dataset.py
Date Fri, 16 Aug 2013 14:24:51 GMT
Author: joyce
Date: Fri Aug 16 14:24:50 2013
New Revision: 1514725

URL: http://svn.apache.org/r1514725
Log:
CLIMATE-254 - Add lat_min property

Modified:
    incubator/climate/branches/RefactorInput/ocw/dataset.py

Modified: incubator/climate/branches/RefactorInput/ocw/dataset.py
URL: http://svn.apache.org/viewvc/incubator/climate/branches/RefactorInput/ocw/dataset.py?rev=1514725&r1=1514724&r2=1514725&view=diff
==============================================================================
--- incubator/climate/branches/RefactorInput/ocw/dataset.py (original)
+++ incubator/climate/branches/RefactorInput/ocw/dataset.py Fri Aug 16 14:24:50 2013
@@ -131,7 +131,7 @@ class Dataset:
         return time_resolution
 
 
-class Bounds:
+class Bounds(object):
     '''Container for holding spatial and temporal bounds information.
 
     Certain operations require valid bounding information to be present for
@@ -142,6 +142,7 @@ class Bounds:
 
     * Latitude values must be in the range [-90, 90]
     * Longitude values must be in the range [-180, 180]
+    * Lat/Lon Min values must be less than the corresponding Lat/Lon Max values.
     * Temporal bounds must a valid datetime object
     '''
 
@@ -174,3 +175,15 @@ class Bounds:
         self._lon_max = lon_max
         self._start = start
         self._end = end
+
+    @property
+    def lat_min(self):
+        print self._lat_min
+        return self._lat_min
+
+    @lat_min.setter
+    def lat_min(self, value):
+        if not (-90 <= value <= 90 and value < self._lat_max):
+            raise ValueError("Attempted to set lat_min to invalid value.")
+
+        self._lat_min = value



Mime
View raw message