コード例 #1
0
ファイル: testTiming.py プロジェクト: ttm/gmaneLegacy
import gmaneLegacy as g, os
ENV = os.environ["PATH"]
import importlib
from IPython.lib.deepreload import reload as dreload
importlib.reload(g.loadMessages)
importlib.reload(g.listDataStructures)
importlib.reload(g.timeStatistics)
#importlib.reload(g.interactionNetwork)
#importlib.reload(g.networkMeasures)
dreload(g, exclude="pytz")
os.environ["PATH"] = ENV

dl = g.DownloadGmaneData('~/.gmane2/')
dl.downloadedStats()  # might take a while

lm = g.LoadMessages(dl.lists[0][0], basedir="~/.gmane2/")
print("loaded messages")
ds = g.ListDataStructures(lm)
print("made datastructures")
ts = g.TimeStatistics(ds)
print("made overall activity statistics along time")
コード例 #2
0
ファイル: testDrawer.py プロジェクト: ttm/gmaneLegacy
import gmaneLegacy as g
#importlib.reload(g.loadMessages)
#importlib.reload(g.listDataStructures)
#importlib.reload(g.interactionNetwork)
#importlib.reload(g.networkMeasures)
#importlib.reload(g.networkPartitioning)
#importlib.reload(g.networkDrawer)
#dreload(g,exclude="pytz")

dl=g.DownloadGmaneData('~/.gmane2/')
dl.downloadedStats() # might take a while
print("made liststats")

lm=g.LoadMessages(dl.lists[0][0],basedir="~/.gmane2/")
print("loaded messages")
ds=g.ListDataStructures(lm)
print("made datastructures")
iN=g.InteractionNetwork(ds)
print("made interaction network")
nm=g.NetworkMeasures(iN)
print("network mesaures")
np=g.NetworkPartitioning(nm,3)
print("partitioned network")


nd=g.NetworkDrawer()
print("drawer started")
nd.makeLayout(nm)
print("gave (x,y) for each author with 5-15-80")
nd2=g.NetworkDrawer()
print("drawer two started")
コード例 #3
0
import  importlib
import multiprocessing as mp
from IPython.lib.deepreload import reload as dreload
import gmaneLegacy as g
importlib.reload(g.listDataStructures)
importlib.reload(g.loadMessages)
importlib.reload(g.interactionNetwork)
dreload(g,exclude="pytz")

lm=g.LoadMessages("gmane.ietf.rfc822",10,basedir="~/.gmane2/")
ds=g.ListDataStructures(lm)
iN=g.InteractionNetwork(ds)

dl=g.DownloadGmaneData('~/.gmane2/')
dl.downloadedStats() # might take a while
load_msgs=[]
data_structs=[]
networks=[]
for list_stat in dl.lists[:10]:
    list_id=list_stat[0]
    load_msgs.append(g.LoadMessages(list_id,basedir="~/.gmane2/"))
    data_structs.append(g.ListDataStructures(load_msgs[-1]))
    networks.append(g.InteractionNetwork(data_structs[-1]))
    print("number of nodes: {}, number of edges: {}, number of messages: {} or {} or {}/{}, number of empty messages: {}".format(
            networks[-1].g.number_of_nodes(),
            networks[-1].g.number_of_edges(),
            data_structs[-1].n_messages,
            load_msgs[-1].n_messages,
            list_stat[1]["n_messages"],list_stat[1]["n_empty"],
            len(data_structs[-1].spurious_empty_ids)))
 
コード例 #4
0
ファイル: makeTextTables.py プロジェクト: ttm/gmaneLegacy
###### DATA STRUCTURES
TOTAL_M = 200
dss = []
iNs = []
nms = []
tss = []
nps = []
PDIR = "pickledir/"
for lid in dl.lists[4:6]:
    lid = lid[0]
    print("\n", lid)
    #    label=labels[lid]
    lm = g.LoadMessages(lid, TOTAL_M, basedir="~/.gmane3/")
    print(lid + "{0:.2f} for loading messages".format(T.time() - TT))
    TT = T.time()
    ds = g.ListDataStructures(lm, text="yes")

    print(lid + "{0:.2f} for data structures".format(T.time() - TT))
    TT = T.time()
    dss.append(ds)
    pDump(ds, "{}ds{}.pickle".format(PDIR, lid))

    ts = g.TimeStatistics(ds)
    print("{0:.2f} for statistics along time".format(T.time() - TT))
    TT = T.time()
    tss.append(ts)
    pDump(ts, "{}ts{}.pickle".format(PDIR, lid))

    iN = g.InteractionNetwork(ds)
    print("made interaction network")
    iNs.append(iN)