|
From: <kin...@us...> - 2023-07-19 18:04:22
|
Revision: 7130
http://sourceforge.net/p/teem/code/7130
Author: kindlmann
Date: 2023-07-19 18:04:20 +0000 (Wed, 19 Jul 2023)
Log Message:
-----------
tweaks
Modified Paths:
--------------
teemdoc/trunk/html/img/graph/teem-graph-gen.py
Modified: teemdoc/trunk/html/img/graph/teem-graph-gen.py
===================================================================
--- teemdoc/trunk/html/img/graph/teem-graph-gen.py 2023-07-19 18:03:42 UTC (rev 7129)
+++ teemdoc/trunk/html/img/graph/teem-graph-gen.py 2023-07-19 18:04:20 UTC (rev 7130)
@@ -6,23 +6,21 @@
header = """digraph G {
concentrate=true;
remincross=true;
- searchsize=30000;
rankdir="BT";
- edge [
- arrowhead="vee";
- ]
+ ranksep=0.5;
+ node [ fontname=Courier, fontsize=16 ];
+ edge [ arrowhead="vee" ];
+ { rank = same; gage; dye; alan; tijk }
+ { rank = same; seek; hoover; echo }
"""
-# { rank = same; unrrdu; ell }
-# { rank = same; moss; gage; dye; alan; tijk }
-# { rank = same; limn; bane }
-# { rank = same; seek; hoover; echo }
-# { rank = same; mite; push; coil; pull }
-# ranksep=0.5;
-# mclimit=0.1;
+# searchsize=30000; # doesn't seem to make a difference at least on rgraph
+# { rank = same; unrrdu; ell } NO not anymore, with "unu ilk"
+# { rank = same; limn; bane } (found anyway)
+# { rank = same; mite; push; coil; pull } (found anyway)
-# needed for the tred graph
+# mclimit=0.1;
tailer = """ } """
@@ -35,12 +33,13 @@
return lines
-# print header;
-# print tailer;
+# teem-graph.dot is manually maintained as original dependency graph,
+# which is then reduced via:
+# tred teem-graph.dot > teem-rgraph.dot
+# rgraph is read; first and last lines are dropped
+origlines = readlines('teem-rgraph.dot')[1:-1]
+outname = 'teem-rgraph'
-origlines = readlines('teem-graph.data')
-outname = 'teem-graph'
-
# this may actually not be reproducible ...
sidx = 0
minidx = sidx
@@ -51,7 +50,7 @@
random.seed(sidx)
lines = origlines
random.shuffle(lines)
- f = open('tmp-info.dot', 'w')
+ f = open('tmp.dot', 'w')
print(f'// The info here was randomized w/ seed {sidx}', file=f)
print(header, file=f)
for l in lines:
@@ -58,15 +57,17 @@
print('%s' % l, file=f)
print(tailer, file=f)
f.close()
- res = subprocess.run('/usr/local/bin/dot tmp-info.dot -Tgif -o tmp-graph.gif'.split())
- sz = os.path.getsize('tmp-graph.gif')
+ res = subprocess.run('/usr/local/bin/dot tmp.dot -Tgif -o tmp.gif'.split())
+ sz = os.path.getsize('tmp.gif')
if sz < minsz:
minidx = sidx
minsz = sz
- subprocess.run(f'mv tmp-info.dot {outname}-{sz}-{sidx}.dot'.split())
- subprocess.run(f'mv tmp-graph.gif {outname}-{sz}-{sidx}.gif'.split())
+ subprocess.run(f'mv tmp.dot {outname}-{sz}-{sidx}.dot'.split())
+ subprocess.run(f'mv tmp.gif {outname}-{sz}-{sidx}.gif'.split())
print(f'\n========== {sidx} -> {sz} (previously {minsz}); see {outname}-{sz}-{sidx}.gif')
else:
# print('(%d)' % sz)
pass
sidx = sidx + 1
+
+# clean up intermediate results: rm -f *-rgraph-*-*.{dot,gif} tmp.{dot,gif}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|