[GRASS-SVN] r55657 - in grass-addons/grass7/raster/r.agent: libagent tests
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Apr 8 06:09:34 PDT 2013
Author: mic
Date: 2013-04-08 06:09:34 -0700 (Mon, 08 Apr 2013)
New Revision: 55657
Modified:
grass-addons/grass7/raster/r.agent/libagent/playground.py
grass-addons/grass7/raster/r.agent/tests/test_playground.py
Log:
switch x and y to s-n and w-e
Modified: grass-addons/grass7/raster/r.agent/libagent/playground.py
===================================================================
--- grass-addons/grass7/raster/r.agent/libagent/playground.py 2013-04-08 12:54:15 UTC (rev 55656)
+++ grass-addons/grass7/raster/r.agent/libagent/playground.py 2013-04-08 13:09:34 UTC (rev 55657)
@@ -26,9 +26,9 @@
def stringcoordinate(self, x, y):
"""
Convert string coordinates to float coordinates.
- @param x string x coordinate
- @param y string y coordinate
- @return position as a list of floats
+ @param x string west-east coordinate
+ @param y string south-north coordinate
+ @return position as a list of floats: south-north, west-east
"""
try:
# try to convert the string value to a float
@@ -36,7 +36,7 @@
y = float(y)
# also catch 'inf' and 'nan' ..
if ( x == x ) and ( y == y ) and ( x + y - 1 != x + y ):
- return [float(x), float(y)]
+ return [float(y), float(x)]
else:
return []
except ValueError:
Modified: grass-addons/grass7/raster/r.agent/tests/test_playground.py
===================================================================
--- grass-addons/grass7/raster/r.agent/tests/test_playground.py 2013-04-08 12:54:15 UTC (rev 55656)
+++ grass-addons/grass7/raster/r.agent/tests/test_playground.py 2013-04-08 13:09:34 UTC (rev 55657)
@@ -11,7 +11,7 @@
def test_stringcoordinate(self):
self.assertEqual(self.pg.stringcoordinate("foo","bar"), [])
self.assertEqual(self.pg.stringcoordinate("inf","nan"), [])
- self.assertEqual(self.pg.stringcoordinate("2","3"), [2,3])
+ self.assertEqual(self.pg.stringcoordinate("2","3"), [3,2])
def test_setregion(self):
self.assertTrue(self.pg.region["rows"] == 1)
More information about the grass-commit
mailing list