climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huiky...@apache.org
Subject [1/3] climate git commit: CLIMATE-942 Integer Passed To Temporal Rebin Rather Than String Throws Unknown Unit Type Error
Date Mon, 22 Jan 2018 14:32:47 GMT
Repository: climate
Updated Branches:
  refs/heads/master 1fd1fc451 -> d8278e241


CLIMATE-942 Integer Passed To Temporal Rebin Rather Than String Throws Unknown Unit Type Error


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

Branch: refs/heads/master
Commit: fd9ad3d59c33a8e02069fec7ce0ef30e056896af
Parents: 4cf79f3
Author: Michael Anderson <michaelanderson@Michaels-iMac.local>
Authored: Fri Jan 5 06:19:02 2018 -0500
Committer: Michael Anderson <michaelanderson@Michaels-iMac.local>
Committed: Fri Jan 5 06:19:02 2018 -0500

----------------------------------------------------------------------
 ocw-ui/backend/processing.py                    |  5 +++--
 .../app/scripts/controllers/parameterselect.js  | 20 +++++++++++---------
 2 files changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/fd9ad3d5/ocw-ui/backend/processing.py
----------------------------------------------------------------------
diff --git a/ocw-ui/backend/processing.py b/ocw-ui/backend/processing.py
index 13ebe55..bdb1d38 100644
--- a/ocw-ui/backend/processing.py
+++ b/ocw-ui/backend/processing.py
@@ -216,8 +216,9 @@ def run_evaluation():
                        in target_datasets]
     
     # Do temporal re-bin based off of passed resolution
-    ref_dataset = dsp.temporal_rebin(ref_dataset, time_delta)
-    target_datasets = [dsp.temporal_rebin(ds, time_delta)
+    temporal_resolution_type = data['temporal_resolution_type']
+    ref_dataset = dsp.temporal_rebin(ref_dataset, temporal_resolution_type)
+    target_datasets = [dsp.temporal_rebin(ds, temporal_resolution_type)
                        for ds
                        in target_datasets]
 

http://git-wip-us.apache.org/repos/asf/climate/blob/fd9ad3d5/ocw-ui/frontend/app/scripts/controllers/parameterselect.js
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend/app/scripts/controllers/parameterselect.js b/ocw-ui/frontend/app/scripts/controllers/parameterselect.js
index cad97e0..6514203 100644
--- a/ocw-ui/frontend/app/scripts/controllers/parameterselect.js
+++ b/ocw-ui/frontend/app/scripts/controllers/parameterselect.js
@@ -27,8 +27,8 @@
  * Controller of the ocwUiApp
  */
 angular.module('ocwUiApp')
-.controller('ParameterSelectCtrl', ['$rootScope', '$scope', '$http', '$timeout', 
-						   'selectedDatasetInformation', 'regionSelectParams', 'evaluationSettings', 
+.controller('ParameterSelectCtrl', ['$rootScope', '$scope', '$http', '$timeout',
+						   'selectedDatasetInformation', 'regionSelectParams', 'evaluationSettings',
   function($rootScope, $scope, $http, $timeout, selectedDatasetInformation, regionSelectParams,
evaluationSettings) {
     $scope.datasets = selectedDatasetInformation.getDatasets();
 
@@ -145,6 +145,8 @@ angular.module('ocwUiApp')
         data['temporal_resolution'] = 30;
       }
 
+      data['temporal_resolution_type'] = temporal_res;
+
       // Load the Metrics for the evaluation
       data['metrics'] = []
       var metrics = settings.metrics
@@ -177,7 +179,7 @@ angular.module('ocwUiApp')
             window.location = "#/results";
           }
         }, 100);
-        
+
       }).error(function() {
         $scope.runningEval = false;
       });
@@ -192,13 +194,13 @@ angular.module('ocwUiApp')
       if (parseFloat($scope.displayParams.latMax) > parseFloat($scope.latMax))
         $scope.displayParams.latMax = $scope.latMax;
 
-      if (parseFloat($scope.displayParams.lonMin) < parseFloat($scope.lonMin)) 
+      if (parseFloat($scope.displayParams.lonMin) < parseFloat($scope.lonMin))
         $scope.displayParams.lonMin = $scope.lonMin;
 
-      if (parseFloat($scope.displayParams.lonMax) > parseFloat($scope.lonMax)) 
+      if (parseFloat($scope.displayParams.lonMax) > parseFloat($scope.lonMax))
         $scope.displayParams.lonMax = $scope.lonMax;
 
-      if ($scope.displayParams.start < $scope.start) 
+      if ($scope.displayParams.start < $scope.start)
         $scope.displayParams.start = $scope.start;
 
       if ($scope.displayParams.end > $scope.end)
@@ -213,8 +215,8 @@ angular.module('ocwUiApp')
       $rootScope.$broadcast('redrawOverlays', []);
     }
 
-    $scope.unwatchDatasets = $scope.$watch('datasets', 
-      function() { 
+    $scope.unwatchDatasets = $scope.$watch('datasets',
+      function() {
         var numDatasets = $scope.datasets.length;
         $scope.displayParams.areValid = false;
         $scope.areInUserRegridState = false;
@@ -230,7 +232,7 @@ angular.module('ocwUiApp')
           // Get the valid lat/lon range in the selected datasets.
           for (var i = 0; i < numDatasets; i++) {
             var curDataset = $scope.datasets[i];
-    
+
             latMin = (curDataset['latlonVals']['latMin'] > latMin) ? curDataset['latlonVals']['latMin']
: latMin;
             latMax = (curDataset['latlonVals']['latMax'] < latMax) ? curDataset['latlonVals']['latMax']
: latMax;
             lonMin = (curDataset['latlonVals']['lonMin'] > lonMin) ? curDataset['latlonVals']['lonMin']
: lonMin;


Mime
View raw message