Skip to content

Commit 724a950

Browse files
authored
Merge pull request #42 from saibalmars/community_louvair
Community louvair
2 parents 07b2215 + 76e1997 commit 724a950

File tree

3 files changed

+8
-101
lines changed

3 files changed

+8
-101
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,28 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python-version: [3.6, 3.7, 3.8, 3.9]
21+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
2222
os: [ubuntu-latest, macOS-latest]
2323
include:
2424
- os: ubuntu-latest
25-
path: ~/.cache/pip
2625
- os: macos-latest
27-
path: ~/Library/Caches/pip
2826

2927
steps:
30-
- uses: actions/cache@v2
31-
with:
32-
path: ${{ matrix.path }}
33-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
34-
restore-keys: |
35-
${{ runner.os }}-pip-${{ matrix.python-version }}-
3628
- uses: actions/checkout@v2
3729
- name: Set up Python ${{ matrix.python-version }}
3830
uses: actions/setup-python@v2
3931
with:
4032
python-version: ${{ matrix.python-version }}
41-
- name: Setup macOS dependencies
42-
if: startsWith(runner.os, 'macOS')
43-
run: |
44-
brew install libomp
4533
- name: Install dependencies
4634
run: |
47-
python -m pip install --upgrade pip
48-
python -m pip install flake8 pytest
49-
python -m pip install cython
50-
python -m pip install numpy
51-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
35+
# $CONDA is an environment variable pointing to the root of the miniconda directory
36+
$CONDA/bin/conda install -c conda-forge --file requirements.txt flake8 pytest
5237
- name: Lint with flake8
5338
run: |
5439
# stop the build if there are Python syntax errors or undefined names
55-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
40+
$CONDA/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
5641
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
57-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42+
$CONDA/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
5843
- name: Test with pytest
5944
run: |
60-
pytest
45+
$CONDA/bin/pytest

GraphRicciCurvature/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import logging
2-
import community as community_louvain
2+
import community.community_louvain as community_louvain
33
import networkx as nx
44
import numpy as np
55
from functools import partial, partialmethod

notebooks/tutorial.ipynb

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@
104104
"execution_count": 2,
105105
"metadata": {
106106
"collapsed": false,
107-
"jupyter": {
108-
"outputs_hidden": false
109-
},
110107
"pycharm": {
111108
"name": "#%%\n"
112109
},
@@ -144,9 +141,6 @@
144141
"execution_count": 3,
145142
"metadata": {
146143
"collapsed": false,
147-
"jupyter": {
148-
"outputs_hidden": false
149-
},
150144
"pycharm": {
151145
"name": "#%%\n"
152146
},
@@ -212,9 +206,6 @@
212206
"execution_count": 5,
213207
"metadata": {
214208
"collapsed": false,
215-
"jupyter": {
216-
"outputs_hidden": false
217-
},
218209
"pycharm": {
219210
"name": "#%%\n"
220211
},
@@ -248,9 +239,6 @@
248239
"execution_count": 6,
249240
"metadata": {
250241
"collapsed": false,
251-
"jupyter": {
252-
"outputs_hidden": false
253-
},
254242
"pycharm": {
255243
"name": "#%%\n"
256244
},
@@ -291,9 +279,6 @@
291279
"execution_count": 7,
292280
"metadata": {
293281
"collapsed": false,
294-
"jupyter": {
295-
"outputs_hidden": false
296-
},
297282
"pycharm": {
298283
"name": "#%%\n"
299284
},
@@ -354,9 +339,6 @@
354339
{
355340
"cell_type": "markdown",
356341
"metadata": {
357-
"jupyter": {
358-
"outputs_hidden": false
359-
},
360342
"pycharm": {
361343
"name": "#%% md\n"
362344
}
@@ -371,9 +353,6 @@
371353
"execution_count": 8,
372354
"metadata": {
373355
"collapsed": false,
374-
"jupyter": {
375-
"outputs_hidden": false
376-
},
377356
"pycharm": {
378357
"name": "#%%\n"
379358
},
@@ -408,9 +387,6 @@
408387
"execution_count": 9,
409388
"metadata": {
410389
"collapsed": false,
411-
"jupyter": {
412-
"outputs_hidden": false
413-
},
414390
"pycharm": {
415391
"name": "#%%\n"
416392
},
@@ -438,9 +414,6 @@
438414
"execution_count": 10,
439415
"metadata": {
440416
"collapsed": false,
441-
"jupyter": {
442-
"outputs_hidden": false
443-
},
444417
"pycharm": {
445418
"name": "#%%\n"
446419
},
@@ -480,9 +453,6 @@
480453
"execution_count": 10,
481454
"metadata": {
482455
"collapsed": false,
483-
"jupyter": {
484-
"outputs_hidden": false
485-
},
486456
"pycharm": {
487457
"name": "#%%\n"
488458
},
@@ -508,9 +478,6 @@
508478
"execution_count": 11,
509479
"metadata": {
510480
"collapsed": false,
511-
"jupyter": {
512-
"outputs_hidden": false
513-
},
514481
"pycharm": {
515482
"name": "#%%\n"
516483
},
@@ -564,9 +531,6 @@
564531
"execution_count": 12,
565532
"metadata": {
566533
"collapsed": false,
567-
"jupyter": {
568-
"outputs_hidden": false
569-
},
570534
"pycharm": {
571535
"name": "#%%\n"
572536
},
@@ -594,9 +558,6 @@
594558
"execution_count": 13,
595559
"metadata": {
596560
"collapsed": false,
597-
"jupyter": {
598-
"outputs_hidden": false
599-
},
600561
"pycharm": {
601562
"name": "#%%\n"
602563
},
@@ -636,9 +597,6 @@
636597
"execution_count": 13,
637598
"metadata": {
638599
"collapsed": false,
639-
"jupyter": {
640-
"outputs_hidden": false
641-
},
642600
"pycharm": {
643601
"name": "#%%\n"
644602
},
@@ -669,9 +627,6 @@
669627
"execution_count": 14,
670628
"metadata": {
671629
"collapsed": false,
672-
"jupyter": {
673-
"outputs_hidden": false
674-
},
675630
"pycharm": {
676631
"name": "#%%\n"
677632
},
@@ -724,9 +679,6 @@
724679
"execution_count": 15,
725680
"metadata": {
726681
"collapsed": false,
727-
"jupyter": {
728-
"outputs_hidden": false
729-
},
730682
"pycharm": {
731683
"name": "#%%\n"
732684
},
@@ -824,9 +776,6 @@
824776
"execution_count": 16,
825777
"metadata": {
826778
"collapsed": false,
827-
"jupyter": {
828-
"outputs_hidden": false
829-
},
830779
"pycharm": {
831780
"name": "#%%\n"
832781
},
@@ -867,9 +816,6 @@
867816
"execution_count": 17,
868817
"metadata": {
869818
"collapsed": false,
870-
"jupyter": {
871-
"outputs_hidden": false
872-
},
873819
"pycharm": {
874820
"name": "#%%\n"
875821
},
@@ -991,9 +937,6 @@
991937
"execution_count": 19,
992938
"metadata": {
993939
"collapsed": false,
994-
"jupyter": {
995-
"outputs_hidden": false
996-
},
997940
"pycharm": {
998941
"name": "#%%\n"
999942
},
@@ -1028,9 +971,6 @@
1028971
"execution_count": 20,
1029972
"metadata": {
1030973
"collapsed": false,
1031-
"jupyter": {
1032-
"outputs_hidden": false
1033-
},
1034974
"pycharm": {
1035975
"name": "#%%\n"
1036976
},
@@ -1095,7 +1035,7 @@
10951035
"m^{\\alpha}_x(x_i)=\n",
10961036
"\\begin{cases}\n",
10971037
"\\alpha & \\mbox{ if } x_i = x\\\\\n",
1098-
"1-\\alpha & \\mbox{ if } x_i \\in \\pi(x)\\\\\n",
1038+
"\\frac{1-\\alpha}{|\\pi(x)|} & \\mbox{ if } x_i \\in \\pi(x)\\\\\n",
10991039
"0 & \\mbox{ otherwise }\n",
11001040
"\\end{cases}\n",
11011041
"\\end{equation*}\n",
@@ -1140,9 +1080,6 @@
11401080
"execution_count": 21,
11411081
"metadata": {
11421082
"collapsed": false,
1143-
"jupyter": {
1144-
"outputs_hidden": false
1145-
},
11461083
"pycharm": {
11471084
"name": "#%%\n"
11481085
},
@@ -1163,9 +1100,6 @@
11631100
"execution_count": 22,
11641101
"metadata": {
11651102
"collapsed": false,
1166-
"jupyter": {
1167-
"outputs_hidden": false
1168-
},
11691103
"pycharm": {
11701104
"name": "#%%\n"
11711105
},
@@ -1205,9 +1139,6 @@
12051139
"execution_count": 23,
12061140
"metadata": {
12071141
"collapsed": false,
1208-
"jupyter": {
1209-
"outputs_hidden": false
1210-
},
12111142
"pycharm": {
12121143
"name": "#%%\n"
12131144
},
@@ -1255,9 +1186,6 @@
12551186
"execution_count": 24,
12561187
"metadata": {
12571188
"collapsed": false,
1258-
"jupyter": {
1259-
"outputs_hidden": false
1260-
},
12611189
"pycharm": {
12621190
"name": "#%%\n"
12631191
},
@@ -1305,9 +1233,6 @@
13051233
"execution_count": 25,
13061234
"metadata": {
13071235
"collapsed": false,
1308-
"jupyter": {
1309-
"outputs_hidden": false
1310-
},
13111236
"pycharm": {
13121237
"name": "#%%\n"
13131238
},
@@ -1380,9 +1305,6 @@
13801305
"execution_count": 27,
13811306
"metadata": {
13821307
"collapsed": false,
1383-
"jupyter": {
1384-
"outputs_hidden": false
1385-
},
13861308
"pycharm": {
13871309
"name": "#%%\n"
13881310
},

0 commit comments

Comments
 (0)