Commit e840a3d
authored
Initial Wir to Dag Transformation for pandas (Closes stefan-grafberger#12, Closes stefan-grafberger#7) (PR stefan-grafberger#14)
* Works somewhat with sketchy revisiting, instrumented_calls can maybe get instrumented
* Think I found the issue now
* Capturing the module works now
* works now but still some issues with duplicate instrumented_call insertions
* Updated some comments
* Module inspection now working as intended + cleanup
* Starting to use networkx
* networkx may be a real option
* Coverted more tests to networkx
* Coverted more tests to networkx
* Completed switch to networkx
* moved test for pipeline into pipelines dir
* Simplified code
* Code cleanup
* Added module info to extracted WIR for calls. todo: subscript-index
* Executor and Inspector entry point on string directly
* Updated forgotten test
* Refined capturing of function info
* Subscript instrumentation works
* Cleanup
* trying to find a good solution for some instrumentation edge cases with nested function calls
* found the issue. if ast call nodes in arg, they get recomputed. solution: instrumented after and before separately
* Closer to intended instrumentation: before_call_used_value works
* wip: full efficient call capturing
* Getting closer
* Efficient call capturing for call args works. TODO: subscript and kwargs
* Call args capturing works for both subscripts and calls
* Fixed minor subscript bug
* kwargs capturing works
* wip: code cleanup
* Cleanup. Ast instrumentation finally works as intended
* Add a few tests
* More cleanup
* Removed unused code
* Minor cleanup
* tests with spy to ensure instrumentation works
* Moved annotating wir with module info to separate step
* Prepared implementation of wir2dag transformer
* Updated comment
* wip: remove_all_nodes_but_calls_and_subscripts
* wip: remove_all_nodes_but_calls_and_subscripts
* getting closer
* First draft. Only calls and subscripts survive, but some edges are missing. WIP: writing a test and debugging
* Found bug, todo: polish test
* test_remove_all_nodes_but_calls_and_subscripts works
* Added module info to test_remove_all_nodes_but_calls_and_subscripts test
* Potential minor performance optimisation (sets should be stored as a constant here)
* wip: pandas dag extraction
* wip: adding lineno and col_offset everywhere
* wip: adding lineno and col_offset everywhere
* Updated tests to include line numbers
* added label binarize to list of known functions
* Removed some unused code
* Minor DagVertex __repr__ changes
* PipelineInspector now returns extracted dag1 parent 05edb1b commit e840a3d
File tree
19 files changed
+1181
-240
lines changed- mlinspect
- instrumentation
- requirements
- test
- instrumentation
- pipelines
19 files changed
+1181
-240
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
18 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
19 | 34 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 35 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
27 | 39 | | |
28 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
29 | 144 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments