[GRASS-SVN] r65994 - grass-addons/grass7/raster/r.mcda.topsis
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Aug 23 09:43:08 PDT 2015
Author: gianluca
Date: 2015-08-23 09:43:08 -0700 (Sun, 23 Aug 2015)
New Revision: 65994
Modified:
grass-addons/grass7/raster/r.mcda.topsis/r.mcda.topsis.py
Log:
improve code style, yet!
Modified: grass-addons/grass7/raster/r.mcda.topsis/r.mcda.topsis.py
===================================================================
--- grass-addons/grass7/raster/r.mcda.topsis/r.mcda.topsis.py 2015-08-23 16:18:53 UTC (rev 65993)
+++ grass-addons/grass7/raster/r.mcda.topsis/r.mcda.topsis.py 2015-08-23 16:43:08 UTC (rev 65994)
@@ -51,10 +51,8 @@
#%end
-
import sys
import grass.script as gscript
-#import grass.script.array as garray
from time import time
def standardizedNormalizedMatrix(attributes,weights): #step1 and step2
@@ -63,7 +61,6 @@
gscript.mapcalc("critPow=pow(${criterion},2)",criterion=criterion,overwrite='True')
stats=gscript.parse_command("r.univar",map='critPow',flags='g')
nameMap="_%s" % criterion.split("@")[1]
- mapalgebra="%s=(%s/sqrt(%s))*%s" % (nameMap,criterion,stats['sum'],weight)
gscript.mapcalc("${nameMap}=(${criterion}/sqrt(${sum}))*${weight}", \
nameMap=nameMap,criterion=criterion,sum=stats['sum'],weight=weight,overwrite='True')
criteria.append(nameMap)
More information about the grass-commit
mailing list