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:15:00 UTC

climate git commit: CLIMATE-800 - TypeError in _rcmes_calc_average_on_new_time_unit

Repository: climate
Updated Branches:
  refs/heads/master 89acf56a8 -> a20e3947e


CLIMATE-800 - TypeError in _rcmes_calc_average_on_new_time_unit

- 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/a20e3947
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/a20e3947
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/a20e3947

Branch: refs/heads/master
Commit: a20e3947ebf083230aebbd60f39a7613bc3602fb
Parents: 89acf56
Author: Ibrahim <ja...@gmail.com>
Authored: Fri Jun 3 19:53:30 2016 +0530
Committer: Ibrahim <ja...@gmail.com>
Committed: Tue Jun 14 00:44:08 2016 +0530

----------------------------------------------------------------------
 ocw/dataset_processor.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/a20e3947/ocw/dataset_processor.py
----------------------------------------------------------------------
diff --git a/ocw/dataset_processor.py b/ocw/dataset_processor.py
index a455fb9..bab78e8 100755
--- a/ocw/dataset_processor.py
+++ b/ocw/dataset_processor.py
@@ -947,9 +947,12 @@ def _rcmes_calc_average_on_new_time_unit(data, dates, unit):
         it = 0
         new_date = []
         for day in days_sorted:
-            index = np.where(days = day)[0]
+            index = np.where(days == day)[0]
             new_data[it,:] = ma.mean(data[index,:], axis=0)
-            new_date.append(datetime.datetime(year=day/10000, month=(day % 10000)/100, day=day % 100))
+            y = int(day / 10000)
+            m = int(day % 10000) / 100
+            d = int(day % 100)
+            new_date.append(datetime.datetime(year=y, month=m, day=d))
             it = it+1
         
     return new_data, np.array(new_date)