Commit 9e15786a authored by dirk.wintergruen's avatar dirk.wintergruen
Browse files

more documentation

parent 93e9270f
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7 (anaconda-default)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="R User Library" level="project" /> <orderEntry type="library" name="R User Library" level="project" />
<orderEntry type="library" name="R Skeletons" level="application" /> <orderEntry type="library" name="R Skeletons" level="application" />
......
...@@ -1111,11 +1111,10 @@ def createYearNetworks(ng,startyear,endyear,typ=None, ...@@ -1111,11 +1111,10 @@ def createYearNetworks(ng,startyear,endyear,typ=None,
ynw={} ynw={}
ng_an = ng.copy() ng_an = ng.copy()
#check if progressbar is set
if progressBar is not None: if progressBar is not None:
progressBar.max=endyear progressBar.max=endyear
progressBar.min=startyear progressBar.min=startyear
try: # try a different method in addition try: # try a different method in addition
progressBar.max_value=endyear progressBar.max_value=endyear
progressBar.min_value=startyear progressBar.min_value=startyear
...@@ -1126,7 +1125,7 @@ def createYearNetworks(ng,startyear,endyear,typ=None, ...@@ -1126,7 +1125,7 @@ def createYearNetworks(ng,startyear,endyear,typ=None,
pass pass
iter = range(startyear,endyear) iter = range(startyear,endyear)
#check if tqdm is set
if tqdm is None and progressBar is None: if tqdm is None and progressBar is None:
from tqdm import tqdm from tqdm import tqdm
...@@ -1144,7 +1143,7 @@ def createYearNetworks(ng,startyear,endyear,typ=None, ...@@ -1144,7 +1143,7 @@ def createYearNetworks(ng,startyear,endyear,typ=None,
nw = ng.__class__(directed=True) nw = ng.__class__(directed=True)
old_ids = {} old_ids = {}
logger.debug("new nw type: %s"%type(nw)) logger.debug("new nw type: %s"%type(nw))
## add additiona attributes ## add additional attributes
for k, v in ng.__dict__.items(): for k, v in ng.__dict__.items():
if v: if v:
if hasattr(v,"copy"): if hasattr(v,"copy"):
......
...@@ -232,7 +232,7 @@ settings = {"pers_pers_by_membership": { ...@@ -232,7 +232,7 @@ settings = {"pers_pers_by_membership": {
"ident_attr":"label", "ident_attr":"label",
"doi_all":"doi:10.5072/FK2/GPFUWZ", "doi_all":"doi:10.5072/FK2/GPFUWZ",
"graph_all_file":"kom_pers_directed.graphml" "graph_all_file":"kom_pers_directed.graphml"
}, },
"pers_pers_by_deals_with_and_members": { "pers_pers_by_deals_with_and_members": {
"description":"Personen verbunden mit Personen über die verhandelt wird und Mitglieder", "description":"Personen verbunden mit Personen über die verhandelt wird und Mitglieder",
"doi":"doi:10.5072/FK2/2SVCY5", "doi":"doi:10.5072/FK2/2SVCY5",
...@@ -241,30 +241,16 @@ settings = {"pers_pers_by_membership": { ...@@ -241,30 +241,16 @@ settings = {"pers_pers_by_membership": {
"ident_attr":"label", "ident_attr":"label",
"doi_all":"doi:10.5072/FK2/GPFUWZ", "doi_all":"doi:10.5072/FK2/GPFUWZ",
"graph_all_file":"all_persons_members_and_deals_blocks.graphml" "graph_all_file":"all_persons_members_and_deals_blocks.graphml"
} }
} }
if __name__ == "__main__": """
import igraph example:
from igraph import igraphx
from network_extensions import igraphx
from dataverseTools import handleDataverse
dv = handleDataverse.DataverseHandler("datastore-dev.mpiwg-berlin.mpg.de",
"c4cacadd-d3ac-45f0-94b9-98d5396e302b",
"gmpg-astronomy-gremien")
current_setting = settings["pers_pers_by_membership"]
content = dv.getContent(current_setting["doi_all"],current_setting["graph_all_file"])
with open("tmp.graphml","wb") as outf:
outf.write(content.read())
gr_all = igraph.load(open("tmp.graphml","rb"))
dv_gephi_url="http://localhost:8080/workspace1" dv_gephi_url="http://localhost:8080/workspace1"
ctn = GephiConnection(url=dv_gephi_url) ctn = GephiConnection(url=dv_gephi_url)
stream = GephiGraphStreamer() stream = GephiGraphStreamer()
...@@ -295,5 +281,7 @@ if __name__ == "__main__": ...@@ -295,5 +281,7 @@ if __name__ == "__main__":
print("url error") print("url error")
print(v) print(v)
"""
\ No newline at end of file
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment