From eda860455df3efb287776f5110f2f24e187a6ea3 Mon Sep 17 00:00:00 2001 From: Benoit GAUZERE Date: Fri, 17 Nov 2017 10:45:52 +0100 Subject: [PATCH] Re structuration of project --- notebooks/py-graph_test.ipynb | 1185 +++++++++++++++++++++++++++++ notebooks/test_lib.ipynb | 175 ----- README.md => pygraph/README.md | 0 pygraph/__init__.py | 28 + {c_ext => pygraph/c_ext}/Makefile | 0 pygraph/c_ext/README.md | 6 + {c_ext => pygraph/c_ext}/lsap.cpp | 0 {c_ext => pygraph/c_ext}/lsape_binders.py | 0 {ged => pygraph/ged}/GED.py | 0 {ged => pygraph/ged}/bipartiteGED.py | 0 {ged => pygraph/ged}/costfunctions.py | 0 {kernels => pygraph/kernels}/.gitignore | 0 {utils => pygraph/utils}/graphfiles.py | 0 {utils => pygraph/utils}/utils.py | 0 14 files changed, 1219 insertions(+), 175 deletions(-) delete mode 100644 notebooks/test_lib.ipynb rename README.md => pygraph/README.md (100%) create mode 100644 pygraph/__init__.py rename {c_ext => pygraph/c_ext}/Makefile (100%) create mode 100644 pygraph/c_ext/README.md rename {c_ext => pygraph/c_ext}/lsap.cpp (100%) rename {c_ext => pygraph/c_ext}/lsape_binders.py (100%) rename {ged => pygraph/ged}/GED.py (100%) rename {ged => pygraph/ged}/bipartiteGED.py (100%) rename {ged => pygraph/ged}/costfunctions.py (100%) rename {kernels => pygraph/kernels}/.gitignore (100%) rename {utils => pygraph/utils}/graphfiles.py (100%) rename {utils => pygraph/utils}/utils.py (100%) diff --git a/notebooks/py-graph_test.ipynb b/notebooks/py-graph_test.ipynb index ea50015..f090a59 100644 --- a/notebooks/py-graph_test.ipynb +++ b/notebooks/py-graph_test.ipynb @@ -447,6 +447,1191 @@ "\r", " 26%|██▌ | 48/183 [01:17<03:36, 1.60s/it]" ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 27%|██▋ | 49/183 [01:19<03:36, 1.61s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 27%|██▋ | 50/183 [01:21<03:35, 1.62s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 28%|██▊ | 51/183 [01:23<03:34, 1.63s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 28%|██▊ | 52/183 [01:24<03:34, 1.63s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 29%|██▉ | 53/183 [01:27<03:33, 1.64s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 30%|██▉ | 54/183 [01:29<03:32, 1.65s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 30%|███ | 55/183 [01:31<03:32, 1.66s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 31%|███ | 56/183 [01:33<03:31, 1.67s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 31%|███ | 57/183 [01:35<03:31, 1.68s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 32%|███▏ | 58/183 [01:37<03:30, 1.69s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 32%|███▏ | 59/183 [01:40<03:30, 1.70s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 33%|███▎ | 60/183 [01:42<03:29, 1.70s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 33%|███▎ | 61/183 [01:44<03:28, 1.71s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 34%|███▍ | 62/183 [01:46<03:27, 1.71s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 34%|███▍ | 63/183 [01:48<03:26, 1.72s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 35%|███▍ | 64/183 [01:50<03:24, 1.72s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 36%|███▌ | 65/183 [01:51<03:23, 1.72s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 36%|███▌ | 66/183 [01:53<03:21, 1.72s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 37%|███▋ | 67/183 [01:55<03:20, 1.73s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 37%|███▋ | 68/183 [01:57<03:18, 1.73s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 38%|███▊ | 69/183 [01:59<03:17, 1.73s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 38%|███▊ | 70/183 [02:01<03:15, 1.73s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 39%|███▉ | 71/183 [02:03<03:14, 1.74s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 39%|███▉ | 72/183 [02:05<03:13, 1.74s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 40%|███▉ | 73/183 [02:07<03:11, 1.75s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 40%|████ | 74/183 [02:09<03:10, 1.75s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 41%|████ | 75/183 [02:11<03:09, 1.75s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 42%|████▏ | 76/183 [02:13<03:08, 1.76s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 42%|████▏ | 77/183 [02:15<03:06, 1.76s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 43%|████▎ | 78/183 [02:17<03:05, 1.77s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 43%|████▎ | 79/183 [02:20<03:04, 1.77s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 44%|████▎ | 80/183 [02:22<03:03, 1.78s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 44%|████▍ | 81/183 [02:24<03:01, 1.78s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 45%|████▍ | 82/183 [02:26<03:00, 1.78s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 45%|████▌ | 83/183 [02:28<02:58, 1.79s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 46%|████▌ | 84/183 [02:30<02:57, 1.79s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 46%|████▋ | 85/183 [02:32<02:55, 1.79s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 47%|████▋ | 86/183 [02:34<02:54, 1.80s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 48%|████▊ | 87/183 [02:36<02:53, 1.80s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 48%|████▊ | 88/183 [02:39<02:51, 1.81s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 49%|████▊ | 89/183 [02:41<02:50, 1.81s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 49%|████▉ | 90/183 [02:43<02:49, 1.82s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 50%|████▉ | 91/183 [02:45<02:47, 1.82s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 50%|█████ | 92/183 [02:48<02:46, 1.83s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 51%|█████ | 93/183 [02:50<02:44, 1.83s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 51%|█████▏ | 94/183 [02:52<02:43, 1.84s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 52%|█████▏ | 95/183 [02:54<02:41, 1.84s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 52%|█████▏ | 96/183 [02:57<02:40, 1.85s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 53%|█████▎ | 97/183 [02:59<02:39, 1.85s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 54%|█████▎ | 98/183 [03:02<02:37, 1.86s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 54%|█████▍ | 99/183 [03:04<02:36, 1.86s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 55%|█████▍ | 100/183 [03:06<02:34, 1.86s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 55%|█████▌ | 101/183 [03:08<02:33, 1.87s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 56%|█████▌ | 102/183 [03:11<02:31, 1.87s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 56%|█████▋ | 103/183 [03:13<02:30, 1.88s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 57%|█████▋ | 104/183 [03:15<02:28, 1.88s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 57%|█████▋ | 105/183 [03:17<02:26, 1.88s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 58%|█████▊ | 106/183 [03:19<02:25, 1.88s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 58%|█████▊ | 107/183 [03:21<02:23, 1.89s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 59%|█████▉ | 108/183 [03:24<02:21, 1.89s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 60%|█████▉ | 109/183 [03:26<02:20, 1.89s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 60%|██████ | 110/183 [03:28<02:18, 1.90s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 61%|██████ | 111/183 [03:30<02:16, 1.90s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 61%|██████ | 112/183 [03:33<02:15, 1.90s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 62%|██████▏ | 113/183 [03:35<02:13, 1.91s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 62%|██████▏ | 114/183 [03:37<02:11, 1.91s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 63%|██████▎ | 115/183 [03:39<02:09, 1.91s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 63%|██████▎ | 116/183 [03:42<02:08, 1.92s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 64%|██████▍ | 117/183 [03:44<02:06, 1.92s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 64%|██████▍ | 118/183 [03:47<02:05, 1.93s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 65%|██████▌ | 119/183 [03:49<02:03, 1.93s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 66%|██████▌ | 120/183 [03:52<02:02, 1.94s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 66%|██████▌ | 121/183 [03:55<02:00, 1.95s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 67%|██████▋ | 122/183 [03:58<01:59, 1.95s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 67%|██████▋ | 123/183 [04:02<01:58, 1.98s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 68%|██████▊ | 124/183 [04:06<01:57, 1.99s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 68%|██████▊ | 125/183 [04:09<01:55, 1.99s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 69%|██████▉ | 126/183 [04:11<01:53, 2.00s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 69%|██████▉ | 127/183 [04:14<01:52, 2.01s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 70%|██████▉ | 128/183 [04:17<01:50, 2.01s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 70%|███████ | 129/183 [04:21<01:49, 2.02s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 71%|███████ | 130/183 [04:24<01:47, 2.03s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 72%|███████▏ | 131/183 [04:27<01:46, 2.04s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 72%|███████▏ | 132/183 [04:30<01:44, 2.05s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 73%|███████▎ | 133/183 [04:32<01:42, 2.05s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 73%|███████▎ | 134/183 [04:35<01:40, 2.06s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 74%|███████▍ | 135/183 [04:37<01:38, 2.06s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 74%|███████▍ | 136/183 [04:40<01:37, 2.06s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 75%|███████▍ | 137/183 [04:43<01:35, 2.07s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 75%|███████▌ | 138/183 [04:45<01:33, 2.07s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 76%|███████▌ | 139/183 [04:48<01:31, 2.07s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 77%|███████▋ | 140/183 [04:50<01:29, 2.08s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 77%|███████▋ | 141/183 [04:53<01:27, 2.08s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 78%|███████▊ | 142/183 [04:56<01:25, 2.09s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 78%|███████▊ | 143/183 [04:59<01:23, 2.09s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 79%|███████▊ | 144/183 [05:02<01:21, 2.10s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 79%|███████▉ | 145/183 [05:05<01:20, 2.11s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 80%|███████▉ | 146/183 [05:07<01:17, 2.11s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 80%|████████ | 147/183 [05:10<01:16, 2.11s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 81%|████████ | 148/183 [05:13<01:14, 2.12s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 81%|████████▏ | 149/183 [05:17<01:12, 2.13s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 82%|████████▏ | 150/183 [05:20<01:10, 2.13s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 83%|████████▎ | 151/183 [05:23<01:08, 2.14s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 83%|████████▎ | 152/183 [05:27<01:06, 2.15s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 84%|████████▎ | 153/183 [05:30<01:04, 2.16s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 84%|████████▍ | 154/183 [05:33<01:02, 2.16s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 85%|████████▍ | 155/183 [05:35<01:00, 2.17s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 85%|████████▌ | 156/183 [05:38<00:58, 2.17s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 86%|████████▌ | 157/183 [05:41<00:56, 2.18s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 86%|████████▋ | 158/183 [05:46<00:54, 2.19s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 87%|████████▋ | 159/183 [05:49<00:52, 2.20s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 87%|████████▋ | 160/183 [05:52<00:50, 2.20s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 88%|████████▊ | 161/183 [05:55<00:48, 2.21s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 89%|████████▊ | 162/183 [05:58<00:46, 2.21s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 89%|████████▉ | 163/183 [06:01<00:44, 2.22s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 90%|████████▉ | 164/183 [06:04<00:42, 2.22s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 90%|█████████ | 165/183 [06:07<00:40, 2.22s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 91%|█████████ | 166/183 [06:09<00:37, 2.23s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 91%|█████████▏| 167/183 [06:12<00:35, 2.23s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 92%|█████████▏| 168/183 [06:15<00:33, 2.23s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 92%|█████████▏| 169/183 [06:17<00:31, 2.24s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 93%|█████████▎| 170/183 [06:21<00:29, 2.24s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 93%|█████████▎| 171/183 [06:24<00:26, 2.25s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 94%|█████████▍| 172/183 [06:27<00:24, 2.25s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 95%|█████████▍| 173/183 [06:30<00:22, 2.26s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 95%|█████████▌| 174/183 [06:32<00:20, 2.26s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 96%|█████████▌| 175/183 [06:35<00:18, 2.26s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 96%|█████████▌| 176/183 [06:38<00:15, 2.26s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 97%|█████████▋| 177/183 [06:41<00:13, 2.27s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 97%|█████████▋| 178/183 [06:44<00:11, 2.27s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 98%|█████████▊| 179/183 [06:47<00:09, 2.28s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 98%|█████████▊| 180/183 [06:50<00:06, 2.28s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 99%|█████████▉| 181/183 [06:53<00:04, 2.28s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 99%|█████████▉| 182/183 [06:56<00:02, 2.29s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + "100%|██████████| 183/183 [06:58<00:00, 2.29s/it]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n", + "\r", + " 0%| | 0/183 [00:00" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0, 1, 4]\n" - ] - } - ], - "source": [ - "import networkx as nx\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt\n", - "dataset, y = loadDataset(\"/home/bgauzere/work/Datasets/Acyclic/dataset_bps.ds\")\n", - "nx.draw_networkx(dataset[12])\n", - "plt.show()\n", - "print(list(dataset[12][3]))" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "autoscroll": false, - "ein.tags": "worksheet-0", - "slideshow": { - "slide_type": "-" - } - }, - "outputs": [], - "source": [ - "cf = BasicCostFunction(1,3,1,3)\n", - "N=len(dataset)\n", - "N=10\n", - "ged_distances = np.zeros((N,N))\n", - "for i in range(0,N):\n", - " for j in range(i,N):\n", - " ged_distances[j,i] = ged_distances[i,j] = ged(dataset[i],dataset[j],cf=cf, method='Riesen')[0]\n", - " \n" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "autoscroll": false, - "ein.tags": "worksheet-0", - "slideshow": { - "slide_type": "-" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(0, array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]))\n", - "(0, array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]))\n", - "(0, array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]))\n" - ] - } - ], - "source": [ - "G1=dataset[12]\n", - "G2=dataset[12]\n", - "\n", - "print(ged(G1,G2))\n", - "print(ged(G1,G2,method='Basic'))\n", - "print(ged(G1,G2,method='Riesen'))\n" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "autoscroll": false, - "ein.tags": "worksheet-0", - "slideshow": { - "slide_type": "-" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{0: {0: [0], 3: [0, 3], 1: [0, 3, 1], 4: [0, 3, 4], 2: [0, 3, 4, 2]}, 1: {1: [1], 3: [1, 3], 0: [1, 3, 0], 4: [1, 3, 4], 2: [1, 3, 4, 2]}, 2: {2: [2], 4: [2, 4], 3: [2, 4, 3], 0: [2, 4, 3, 0], 1: [2, 4, 3, 1]}, 3: {3: [3], 0: [3, 0], 1: [3, 1], 4: [3, 4], 2: [3, 4, 2]}, 4: {4: [4], 2: [4, 2], 3: [4, 3], 0: [4, 3, 0], 1: [4, 3, 1]}}\n", - "[[ 0. 2. 3. 1. 2.]\n", - " [ 2. 0. 3. 1. 2.]\n", - " [ 3. 3. 0. 2. 1.]\n", - " [ 1. 1. 2. 0. 1.]\n", - " [ 2. 2. 1. 1. 0.]]\n" - ] - } - ], - "source": [ - "l = nx.shortest_path(G1)\n", - "print(l)\n", - "\n", - "distances = np.zeros((G1.number_of_nodes(),G1.number_of_nodes()))\n", - "for i in l.keys():\n", - " for j in l[i].keys():\n", - " distances[i,j] = len(l[i][j])-1\n", - "\n", - "print(distances)\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.2" - }, - "name": "test_lib.ipynb" - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/README.md b/pygraph/README.md similarity index 100% rename from README.md rename to pygraph/README.md diff --git a/pygraph/__init__.py b/pygraph/__init__.py new file mode 100644 index 0000000..42f83b5 --- /dev/null +++ b/pygraph/__init__.py @@ -0,0 +1,28 @@ +# -*-coding:utf-8 -*- + +""" +Pygraph + +This package contains 4 sub packages : + * c_ext : binders to C++ code + * ged : allows to compute graph edit distance between networkX graphs + * kernels : computation of graph kernels, ie graph similarity measure compatible with SVM + * notebooks : examples of code using this library + * utils : Diverse computation on graphs + +je vous passe le blabla + +""" + +# info +__version__ = "0.1" +__author__ = "Benoit Gaüzère" +__date__ = "November 2017" + +# import sub modules +from c_ext import lsape_binders +from ged import bipartiteGED +from ged import costfunctions +from ged import GED +from utils import graphfiles +from utils import utils diff --git a/c_ext/Makefile b/pygraph/c_ext/Makefile similarity index 100% rename from c_ext/Makefile rename to pygraph/c_ext/Makefile diff --git a/pygraph/c_ext/README.md b/pygraph/c_ext/README.md new file mode 100644 index 0000000..f1aa549 --- /dev/null +++ b/pygraph/c_ext/README.md @@ -0,0 +1,6 @@ +Python wrapper for lsape method + +Specify your LSAPE_DIR env variable with the location of the source +code to compile + +source code : https://bougleux.users.greyc.fr/lsape/ diff --git a/c_ext/lsap.cpp b/pygraph/c_ext/lsap.cpp similarity index 100% rename from c_ext/lsap.cpp rename to pygraph/c_ext/lsap.cpp diff --git a/c_ext/lsape_binders.py b/pygraph/c_ext/lsape_binders.py similarity index 100% rename from c_ext/lsape_binders.py rename to pygraph/c_ext/lsape_binders.py diff --git a/ged/GED.py b/pygraph/ged/GED.py similarity index 100% rename from ged/GED.py rename to pygraph/ged/GED.py diff --git a/ged/bipartiteGED.py b/pygraph/ged/bipartiteGED.py similarity index 100% rename from ged/bipartiteGED.py rename to pygraph/ged/bipartiteGED.py diff --git a/ged/costfunctions.py b/pygraph/ged/costfunctions.py similarity index 100% rename from ged/costfunctions.py rename to pygraph/ged/costfunctions.py diff --git a/kernels/.gitignore b/pygraph/kernels/.gitignore similarity index 100% rename from kernels/.gitignore rename to pygraph/kernels/.gitignore diff --git a/utils/graphfiles.py b/pygraph/utils/graphfiles.py similarity index 100% rename from utils/graphfiles.py rename to pygraph/utils/graphfiles.py diff --git a/utils/utils.py b/pygraph/utils/utils.py similarity index 100% rename from utils/utils.py rename to pygraph/utils/utils.py