climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From good...@apache.org
Subject svn commit: r1501270 - in /incubator/climate/trunk/rcmet/src/main/python/rcmes: cli/rcmet_ui.py utils/misc.py
Date Tue, 09 Jul 2013 14:01:18 GMT
Author: goodale
Date: Tue Jul  9 14:01:18 2013
New Revision: 1501270

URL: http://svn.apache.org/r1501270
Log:
CLIMATE-179 - Added in some simple guards to stop a user from making a bad selection from
command line interface.

Modified:
    incubator/climate/trunk/rcmet/src/main/python/rcmes/cli/rcmet_ui.py
    incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py

Modified: incubator/climate/trunk/rcmet/src/main/python/rcmes/cli/rcmet_ui.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/python/rcmes/cli/rcmet_ui.py?rev=1501270&r1=1501269&r2=1501270&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/python/rcmes/cli/rcmet_ui.py (original)
+++ incubator/climate/trunk/rcmet/src/main/python/rcmes/cli/rcmet_ui.py Tue Jul  9 14:01:18
2013
@@ -50,6 +50,11 @@ def rcmetUI():
     workDir, cacheDir = misc.getDirSettings()
     temporalGrid = misc.getTemporalGrid()
     spatialGrid = misc.getSpatialGrid()
+    
+    # PER CLIMATE-179 - Guard against a bad spatialGrid Selection
+    while spatialGrid == False:
+        spatialGrid = misc.getSpatialGrid()
+        
     jobProperties = JobProperties(workDir, cacheDir, spatialGrid, temporalGrid)
     
     # Section 1a: Enter model file/s

Modified: incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py?rev=1501270&r1=1501269&r2=1501270&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py (original)
+++ incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py Tue Jul  9 14:01:18
2013
@@ -1186,7 +1186,11 @@ def getSpatialGrid():
     options = ['obs', 'model', 'user']
     print("Please select one of the following Spatial Grid Options:\n")
     for key, option in enumerate(options):
-        print("[%s] - %s" % (key, option))
+        # PER CLIMATE-179 a temporary print statement has been put in place
+        if option == 'obs':
+            print("[%s] - TODO: %s" % (key, option))
+        else:
+            print("[%s] - %s" % (key, option))
 
     choice = int(raw_input(">>>"))
     try:
@@ -1194,8 +1198,13 @@ def getSpatialGrid():
     except IndexError:
         getSpatialGrid()
 
-    return spatialGrid
-
+    # PER CLIMATE-179 a temporary guard has also been put in place
+    if spatialGrid == 'obs':
+        print 'Using an observational grid for Spatial regridding is not currently supported.'
+        print 'If you know the grid size and spacing you could use the user option instead\n'
+        return False
+    else:
+        return spatialGrid
 def askUserForVariableName(variableNames, targetName):
     if targetName == "analysis":
         print("Select the variable you want to use for analysis/metrics:")



Mime
View raw message