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 2013/08/16 16:45:35 UTC
svn commit: r1514738 -
/incubator/climate/branches/RefactorInput/ocw/dataset.py
Author: joyce
Date: Fri Aug 16 14:45:35 2013
New Revision: 1514738
URL: http://svn.apache.org/r1514738
Log:
CLIMATE-254 - Add start 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=1514738&r1=1514737&r2=1514738&view=diff
==============================================================================
--- incubator/climate/branches/RefactorInput/ocw/dataset.py (original)
+++ incubator/climate/branches/RefactorInput/ocw/dataset.py Fri Aug 16 14:45:35 2013
@@ -24,6 +24,7 @@ Classes:
import numpy
import logging
+import datetime as dt
class Dataset:
'''Container for a dataset's attributes and data.'''
@@ -219,3 +220,14 @@ class Bounds(object):
raise ValueError("Attempted to set lon_max to invalid value.")
self._lon_max = value
+
+ @property
+ def start(self):
+ return self._start
+
+ @start.setter
+ def start(self, value):
+ if not (type(value) is dt.datetime and value < self._end):
+ raise ValueError("Attempted to set start to invalid value")
+
+ self._start = value