本文整理汇总了Python中SSUtilities.returnDecimalChar方法的典型用法代码示例。如果您正苦于以下问题:Python SSUtilities.returnDecimalChar方法的具体用法?Python SSUtilities.returnDecimalChar怎么用?Python SSUtilities.returnDecimalChar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SSUtilities
的用法示例。
在下文中一共展示了SSUtilities.returnDecimalChar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createInterpretReport
# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import returnDecimalChar [as 别名]
def createInterpretReport(self):
"""Creates the interpretation table for OLS."""
#### Generate Interpretation Table #####
header = ARCPY.GetIDMessage(84081)
#### Set up Rows in Tables ####
decimalSep = UTILS.returnDecimalChar()
if decimalSep == ".":
pValue = "0.01"
VIF = "7.5"
else:
pValue = "0,01"
VIF = "7,5"
significance = [ARCPY.GetIDMessage(84111), ARCPY.GetIDMessage(84082).format(pValue)]
coefficient = [ARCPY.GetIDMessage(84080), ARCPY.GetIDMessage(84349)]
probs = [ARCPY.GetIDMessage(84086), ARCPY.GetIDMessage(84350).format(pValue)]
multicoll = [ARCPY.GetIDMessage(84103), ARCPY.GetIDMessage(84083).format(VIF)]
rSquared = [ARCPY.GetIDMessage(84104), ARCPY.GetIDMessage(84084)]
jointFW = [ARCPY.GetIDMessage(84105), ARCPY.GetIDMessage(84085).format(pValue)]
bpRow = [ARCPY.GetIDMessage(84106), ARCPY.GetIDMessage(84087).format(pValue)]
jbRow = [ARCPY.GetIDMessage(84107), ARCPY.GetIDMessage(84088).format(pValue)]
#### Finalize Interpretation Table ####
intTotal = [significance, coefficient, probs, multicoll,
rSquared, jointFW, bpRow, jbRow]
body = UTILS.outputTextTable(intTotal, pad = 1,
justify = ["center", "left"])
self.interpretTable = "\n%s%s" % (header, body)
self.interpretRaw = intTotal
示例2: createOutputGraphic
# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import returnDecimalChar [as 别名]
#.........这里部分代码省略.........
if numNoNeighs:
d += strNoNeighs
else:
d += " "
grid.writeCell((grid.rowCount, 0), d,
justify = "right")
grid.writeCell((grid.rowCount, 1),
LOCALE.format("%0.6f", gi),
justify = "right")
grid.writeCell((grid.rowCount, 2),
LOCALE.format("%0.6f", ei),
justify = "right")
grid.writeCell((grid.rowCount, 3),
LOCALE.format("%0.6f", vi),
justify = "right")
grid.writeCell((grid.rowCount, 4),
LOCALE.format("%0.6f", zi),
justify = "right")
grid.writeCell((grid.rowCount, 5),
LOCALE.format("%0.6f", pv),
justify = "right")
grid.stepRow()
if grid.rowCount <= 19:
grid.createLineRow(grid.rowCount, startCol = 0, endCol = 7)
grid.stepRow()
#### Add Footnotes, Peaks, Linear Unit, No Neighbor Message ####
footNotes = []
#### Report Peaks ####
firstPeakMess = ARCPY.GetIDMessage(84419)
decimalSep = UTILS.returnDecimalChar()
if decimalSep == ".":
numSep = ","
else:
numSep = ";"
if self.firstPeakInd != None:
zi = LOCALE.format("%0.6f", self.giResults[self.firstPeakInd,4])
d = LOCALE.format("%0.2f", round(self.firstPeakDistance, 2))
firstPeakMess = firstPeakMess.format(d, numSep, zi)
else:
firstPeakMess = firstPeakMess.format("None",numSep, "None")
footNotes += REPORT.splitFootnote(firstPeakMess, 145)
maxPeakMess = ARCPY.GetIDMessage(84420)
if self.maxPeakInd != None:
zi = LOCALE.format("%0.6f", self.giResults[self.maxPeakInd,4])
d = LOCALE.format("%0.2f", round(self.maxPeakDistance, 2))
maxPeakMess = maxPeakMess.format(d, numSep, zi)
else:
maxPeakMess = maxPeakMess.format("None",numSep, "None")
footNotes += REPORT.splitFootnote(maxPeakMess, 145)
#### Add Linear/Angular Unit ####
distanceOut = self.ssdo.distanceInfo.outputString
dmsg = ARCPY.GetIDMessage(84344)
distanceMeasuredStr = dmsg.format(distanceOut)
footNotes += REPORT.splitFootnote(distanceMeasuredStr, 145)
#### Add No Neighbor Message ####
if hasNoNeighs:
noNeighMess = ARCPY.GetIDMessage(84417)
footNotes += REPORT.splitFootnote(noNeighMess, 145)
示例3: report
# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import returnDecimalChar [as 别名]
def report(self, fileName = None):
"""Reports the Moran's I results as a message or to a file.
INPUTS:
fileName {str, None}: path to a text file to populate with results.
"""
header = ARCPY.GetIDMessage(84160) + ARCPY.GetIDMessage(84282)
results = [ self.resLabels ]
hasNoNeighs = self.noNeighs.any()
strNoNeighs = ARCPY.GetIDMessage(84111)
#### Create Output Text Table ####
for testIter in range(self.nIncrements):
d, gi, ei, vi, zi, pv = self.giResults[testIter]
d = LOCALE.format("%0.2f", round(d, 2))
gi = LOCALE.format("%0.6f", gi)
ei = LOCALE.format("%0.6f", ei)
vi = LOCALE.format("%0.6f", vi)
zi = LOCALE.format("%0.6f", zi)
pv = LOCALE.format("%0.6f", pv)
#### Add Asterisk to No Neigh Distances ####
if hasNoNeighs:
numNoNeighs = self.noNeighs[testIter]
if numNoNeighs:
d += strNoNeighs
else:
d += " "
res = [d, gi, ei, vi, zi, pv]
results.append(res)
outputReport = UTILS.outputTextTable(results, header = header,
justify = "right", pad = 1)
#### Report Peaks ####
firstPeakMess = ARCPY.GetIDMessage(84419)
decimalSep = UTILS.returnDecimalChar()
if decimalSep == ".":
numSep = ","
else:
numSep = ";"
if self.firstPeakInd != None:
zi = LOCALE.format("%0.6f", self.giResults[self.firstPeakInd,4])
d = LOCALE.format("%0.2f", round(self.firstPeakDistance, 2))
firstPeakMess = firstPeakMess.format(d, numSep, zi)
else:
firstPeakMess = firstPeakMess.format("None", numSep, "None")
outputReport += "\n" + firstPeakMess + "\n"
maxPeakMess = ARCPY.GetIDMessage(84420)
if self.maxPeakInd != None:
zi = LOCALE.format("%0.6f", self.giResults[self.maxPeakInd,4])
d = LOCALE.format("%0.2f", round(self.maxPeakDistance, 2))
maxPeakMess = maxPeakMess.format(d, numSep, zi)
else:
maxPeakMess = maxPeakMess.format("None", numSep,"None")
outputReport += maxPeakMess
#### Add Linear/Angular Unit ####
distanceOut = self.ssdo.distanceInfo.outputString
dmsg = ARCPY.GetIDMessage(84344)
distanceMeasuredStr = dmsg.format(distanceOut)
outputReport += "\n%s\n" % distanceMeasuredStr
if fileName:
if hasNoNeighs:
noNeighMess = ARCPY.GetIDMessage(84417) + "\n"
outputReport += noNeighMess
f = UTILS.openFile(fileName, "w")
f.write(outputReport)
f.close()
else:
ARCPY.AddMessage(outputReport)
if hasNoNeighs:
ARCPY.AddIDMessage("WARNING", 1532)
return outputReport
示例4: endSummary
# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import returnDecimalChar [as 别名]
#.........这里部分代码省略.........
signResults = signColInfo + signResults
self.signReport = UTILS.outputTextTable(signResults,
header = signHeader,
justify = ["left", "right",
"right", "right"],
pad = 1)
if self.perfectMultiWarnBool:
vifHeader += ARCPY.GetIDMessage(84111)
self.vifReport = UTILS.outputTextTable(vifResults, header = vifHeader,
justify = ["left", "right",
"center", "left"],
pad = 1)
#### Add Perfect Multi Warning ####
if self.perfectMultiWarnBool:
msg = ARCPY.GetIDMessage(84409) + "\n" + ARCPY.GetIDMessage(84410)
self.vifReport += msg
##### Residual Normality Summary ####
jbHeader = ARCPY.GetIDMessage(84310)
jbResults = [ [ARCPY.GetIDMessage(84042), ARCPY.GetIDMessage(84021),
ARCPY.GetIDMessage(84249), ARCPY.GetIDMessage(84036),
ARCPY.GetIDMessage(84284), ARCPY.GetIDMessage(84292),
ARCPY.GetIDMessage(84286)] ]
jbResults += self.jbReportRows
self.jbReport = UTILS.outputTextTable(jbResults, header = jbHeader,
pad = 1, justify = masterJustify)
##### Residual Autocorrelation ####
if not self.allMIPass:
miHeader = ARCPY.GetIDMessage(84311)
miResults = [ [ARCPY.GetIDMessage(84292), ARCPY.GetIDMessage(84021),
ARCPY.GetIDMessage(84249), ARCPY.GetIDMessage(84042),
ARCPY.GetIDMessage(84036), ARCPY.GetIDMessage(84284),
ARCPY.GetIDMessage(84286)] ]
miResults += self.miReportRows
justify = ["right"] * 6 + ["left"]
self.miReport = UTILS.outputTextTable(miResults, header = miHeader,
pad = 1, justify = masterJustify)
else:
self.miReport = "\n" + ARCPY.GetIDMessage(84311)
self.miReport += " (" + ARCPY.GetIDMessage(84500) + ")\n"
#### Significance Locale String ####
decimalSep = UTILS.returnDecimalChar()
modelString2 = ARCPY.GetIDMessage(84314)
if decimalSep == ".":
numSep = ","
else:
numSep = ";"
modelString2 = modelString2.format(LOCALE.format("%0.2f", .1), numSep,
LOCALE.format("%0.2f", .05),
LOCALE.format("%0.2f", .01))
##### Abbreviation Table ####
modelStrip = ARCPY.GetIDMessage(84286).strip()
abbHeader = ARCPY.GetIDMessage(84312)
modelString1 = ARCPY.GetIDMessage(84313)
abbResults = [ [ARCPY.GetIDMessage(84021),ARCPY.GetIDMessage(84315)],
[ARCPY.GetIDMessage(84249),ARCPY.GetIDMessage(84316)],
[ARCPY.GetIDMessage(84042),ARCPY.GetIDMessage(84317)],
[ARCPY.GetIDMessage(84036),ARCPY.GetIDMessage(84318)],
[ARCPY.GetIDMessage(84284),ARCPY.GetIDMessage(84319)],
[ARCPY.GetIDMessage(84292),ARCPY.GetIDMessage(84320)],
[modelStrip, modelString1],
[modelStrip, modelString2]]
self.abbReport = UTILS.outputTextTable(abbResults)
self.abbReport = "\n" + abbHeader + "\n" + self.abbReport + "\n"
##### Display Tables ####
starMess = "*" * 78
dashMess = "-" * 78
ARCPY.AddMessage(starMess)
globalHeader = ARCPY.GetIDMessage(84321)
globalHeader = globalHeader.format(self.dependentVar)
globalHeader = globalHeader.center(78, "*")
ARCPY.AddMessage(globalHeader)
ARCPY.AddMessage(self.passReport)
ARCPY.AddMessage(dashMess)
ARCPY.AddMessage(self.signReport)
ARCPY.AddMessage(dashMess)
ARCPY.AddMessage(self.vifReport)
ARCPY.AddMessage(dashMess)
ARCPY.AddMessage(self.jbReport)
ARCPY.AddMessage(dashMess)
ARCPY.AddMessage(self.miReport)
ARCPY.AddMessage(dashMess)
ARCPY.AddMessage(self.abbReport)
ARCPY.AddMessage(dashMess)
self.fullReport = [starMess, globalHeader, self.passReport,
dashMess, self.signReport,
dashMess, self.vifReport,
dashMess, self.jbReport,
dashMess, self.miReport,
dashMess, self.abbReport,
dashMess]
self.fullReport = "\n".join(self.fullReport)