本文整理匯總了Python中Data.set_pw_default_stat方法的典型用法代碼示例。如果您正苦於以下問題:Python Data.set_pw_default_stat方法的具體用法?Python Data.set_pw_default_stat怎麽用?Python Data.set_pw_default_stat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Data
的用法示例。
在下文中一共展示了Data.set_pw_default_stat方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: PooGUI
# 需要導入模塊: import Data [as 別名]
# 或者: from Data import set_pw_default_stat [as 別名]
#.........這裏部分代碼省略.........
f = tkFileDialog.askopenfile(mode='r',initialfile="coords.txt")
print f
else:
f = open( f )
for i,line in enumerate(f):
p = Population()
p.load_line(line)
self.d.add_pop(p)
sUI = SampleUIWPop(pop=p, master=self.sample_frame,
config = self.c, data=self.d,
cluster=default_cluster)
sUI.grid(column=0,row=i, sticky="ew")
#create plotting circles and register events
self.canvas['H'].panel.add_artist( sUI.circH )
self.canvas['Psi'].panel.add_artist( sUI.circP )
sUI.circH.connect()
sUI.circP.connect()
self.add_sample( sUI )
self.nCoords = len( self.d.sList )
self.activeCanvas.redraw()
def loadPsi(self,f=None):
"""loads Psi directly. Assumes Coordinates are already loaded"""
if f is None:
f = tkFileDialog.askopenfile(mode='r',initialfile="psi.txt")
self.d.add_pw_stat('psi', AntiCommutativePWStat(f=pw_psi))
if self.d.pw_default_stat is None:
self.d.set_pw_default_stat('psi')
psiRaw = np.loadtxt(f, dtype="S100")
for row in psiRaw:
self.d.pairwise_stats['psi'][ row[0], row[1] ] = float(row[2])
psi_sum = psi_sum_cluster(self.d.pairwise_stats['psi'],
self.d.sList)
self.d.add_single_pop_stat('psi_sum',psi_sum)
self.d.sort_stat="psi_sum"
self.initPsiMatrix(self.master)
self.d.update_all_colors()
self.d.update_sample_order()
#self.set_colors()
self.canvas['H'].draw_all_hyperbolas()
self.canvas['Psi'].draw_all_pairwise_psi()
def loadBGI(self, f=None):
"""loads Background image"""
if f is None:
f = tkFileDialog.askopenfile(mode='r')
try:
self.bgi = mpimg.imread(f)
except:
raise ValueError("could not read image file, see"+ \
" matplotlib.image.imread for"+ \
" supported formats")
self.canvas['H'].addBGI(self.bgi)
self.canvas['Psi'].addBGI(self.bgi)