graphkit icon indicating copy to clipboard operation
graphkit copied to clipboard

FEAT: ExecutionPlan remember compilation results for elaborate plots

Open ankostis opened this issue 6 years ago • 4 comments

Continuation (and bugfixing) of #26 (refact dag solver). t t

  • Merge with #13 (enhanced plots) to study bugs, the input & outputs used to build it, and to reason.
  • Network:
    • WIP/FIX: CONSISTENT ORDERED networkx.DiGraph for deterministic results (#22-2.4.3) - TCs were failing in < PY3.5.. Unfortunately, it has not been fixed yet, just reduced the frequencyof failures, probably due to:
      • dicts,
      • use of subgraphs.
    • ENH: Mark allo data in NetworkOperation's need as optional. TODO: subgraph netops would not be fully functional until "optional outpus" are dealt with.
    • ENH: ExecutionPlan to know which operations have actually executed.
    • ENH: prunning drops also isolates (untested!).
    • fix: fix net.last_plan was never set (64e0028).
    • DROP: list_layers()/show layers() not needed, repr() is ok.
  • PLOT:
    • ENH: a pipeline plots last_plan if found. resolve issue with user args not passing through.
    • FIX: were failing if steps not a list/ is none.
    • ENH: +title, demarcate "broken links", cluster pruned nodes, draw executed operations drawn as filled.
    • REFACT: Move all API doc on plotting in a single module, splitted in 2 phases:
      • build dot
      • render dot
    • ENH(TCs): PYTEST-ize & strongly enhance plotting TCs.

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

ankostis avatar Oct 06 '19 15:10 ankostis

Codecov Report

Merging #29 into master will increase coverage by 12.9%. The diff coverage is 92.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
+ Coverage   77.87%   90.77%   +12.9%     
==========================================
  Files           5        6       +1     
  Lines         348      488     +140     
==========================================
+ Hits          271      443     +172     
+ Misses         77       45      -32
Impacted Files Coverage Δ
graphkit/functional.py 93.42% <100%> (-0.33%) :arrow_down:
graphkit/plot.py 89.68% <89.68%> (ø)
graphkit/base.py 80.76% <90.47%> (+1.4%) :arrow_up:
graphkit/network.py 94.02% <93.93%> (+23.82%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e70718b...8c41066. Read the comment docs.

codecov-io avatar Oct 07 '19 03:10 codecov-io

After FIX for deterministic results in < PY3.5 (fce0515), this can merge.

ankostis avatar Oct 07 '19 18:10 ankostis

And this is the legend:

t

(note that oval with circle are switched for operations)

Code to reproduce:

    digraph {
        rankdir=LR;
        subgraph cluster_legend {
        label="Graphkit Legend";
        
        operation   [shape=oval];
        pipeline    [shape=circle];
        insteps     [penwidth=3 label="in steps"];
        executed    [style=filled fillcolor=wheat];
        operation -> pipeline -> insteps -> executed [style=invis];

        data    [shape=rect];
        input   [shape=invhouse];
        output  [shape=house];
        inp_out [shape=hexagon label="inp+out"];
        evicted [shape=rect penwidth=3 color="#990000"];
        pinned  [shape=rect penwidth=3 color="purple"];
        evpin   [shape=rect penwidth=3 color=purple label="evict+pin"];
        sol     [shape=rect style=filled fillcolor=wheat label="in solution"];
        data -> input -> output -> inp_out -> evicted -> pinned -> evpin -> sol [style=invis];

        a1 [style=invis] b1 [color=invis label="dependency"];
        a1 -> b1;
        a2 [style=invis] b2 [color=invis label="optional"];
        a2 -> b2 [style=dashed];
        a3 [style=invis] b3 [color=invis penwidth=3 label="broken dependency"];
        a3 -> b3 [color=wheat penwidth=2];
        a4 [style=invis] b4 [color=invis penwidth=4 label="steps sequence"];
        a4 -> b4 [color="#009999" penwidth=4 style=dotted arrowhead=vee];
        b1 -> a2 [style=invis];
        b2 -> a3 [style=invis];
        b3 -> a4 [style=invis];
        }
    }

ankostis avatar Oct 07 '19 19:10 ankostis

$ date
Tue 08 Oct 2019 07:01:59 PM EEST
$ cloc --by-file-by-lang  graphkit 
       6 text files.
       6 unique files.                              
       0 files ignored.

github.com/AlDanial/cloc v 1.82  T=0.01 s (537.8 files/s, 142257.3 lines/s)
------------------------------------------------------------------------------------
File                                  blank        comment           code
------------------------------------------------------------------------------------
graphkit/network.py                     145            305            253
graphkit/plot.py                         83            166            162
graphkit/base.py                         40             87             89
graphkit/functional.py                   48             77             82
graphkit/__init__.py                      3              3              5
graphkit/modifiers.py                     8             29              2
------------------------------------------------------------------------------------
SUM:                                    327            667            593
------------------------------------------------------------------------------------

-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Python                           6            327            667            593
-------------------------------------------------------------------------------
SUM:                             6            327            667            593
-------------------------------------------------------------------------------

ankostis avatar Oct 08 '19 16:10 ankostis