You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by ja...@apache.org on 2016/06/13 19:06:28 UTC
climate git commit: CLIMATE-796 - TypeError in temporal_slice function
Repository: climate
Updated Branches:
refs/heads/master a879f70df -> cd3eea5dc
CLIMATE-796 - TypeError in temporal_slice function
Fix TypeError in dataset processor module
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/cd3eea5d
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/cd3eea5d
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/cd3eea5d
Branch: refs/heads/master
Commit: cd3eea5dc9f913bb722bc0e0ddffc0c37267d478
Parents: a879f70
Author: Ibrahim <ja...@gmail.com>
Authored: Mon May 30 15:06:03 2016 +0530
Committer: Ibrahim <ja...@gmail.com>
Committed: Tue Jun 14 00:34:52 2016 +0530
----------------------------------------------------------------------
ocw/dataset_processor.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/cd3eea5d/ocw/dataset_processor.py
----------------------------------------------------------------------
diff --git a/ocw/dataset_processor.py b/ocw/dataset_processor.py
index a259ad3..c0e384f 100755
--- a/ocw/dataset_processor.py
+++ b/ocw/dataset_processor.py
@@ -424,9 +424,10 @@ def temporal_slice(start_time_index, end_time_index, target_dataset):
:raises: ValueError
'''
-
- timeStart = min(np.nonzero(target_dataset.times >= start_time_index)[0])
- timeEnd = max(np.nonzero(target_dataset.times <= end_time_index)[0])
+ start_date = target_dataset.times[start_time_index]
+ end_date = target_dataset.times[end_time_index]
+ timeStart = min(np.nonzero(target_dataset.times >= start_date)[0])
+ timeEnd = max(np.nonzero(target_dataset.times <= end_date)[0])
target_dataset.times = target_dataset.times[timeStart:timeEnd+1]
target_dataset.values = target_dataset.values[timeStart:timeEnd+1,:]