Skip to content

Commit

Permalink
Merge pull request #42 from saibalmars/community_louvair
Browse files Browse the repository at this point in the history
Community louvair
  • Loading branch information
saibalmars committed Aug 22, 2023
2 parents 07b2215 + 76e1997 commit 724a950
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 101 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,28 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest, macOS-latest]
include:
- os: ubuntu-latest
path: ~/.cache/pip
- os: macos-latest
path: ~/Library/Caches/pip

steps:
- uses: actions/cache@v2
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup macOS dependencies
if: startsWith(runner.os, 'macOS')
run: |
brew install libomp
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install cython
python -m pip install numpy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# $CONDA is an environment variable pointing to the root of the miniconda directory
$CONDA/bin/conda install -c conda-forge --file requirements.txt flake8 pytest
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
$CONDA/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
$CONDA/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
$CONDA/bin/pytest
2 changes: 1 addition & 1 deletion GraphRicciCurvature/util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
import community as community_louvain
import community.community_louvain as community_louvain
import networkx as nx
import numpy as np
from functools import partial, partialmethod
Expand Down
80 changes: 1 addition & 79 deletions notebooks/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@
"execution_count": 2,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -144,9 +141,6 @@
"execution_count": 3,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -212,9 +206,6 @@
"execution_count": 5,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -248,9 +239,6 @@
"execution_count": 6,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -291,9 +279,6 @@
"execution_count": 7,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -354,9 +339,6 @@
{
"cell_type": "markdown",
"metadata": {
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%% md\n"
}
Expand All @@ -371,9 +353,6 @@
"execution_count": 8,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -408,9 +387,6 @@
"execution_count": 9,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -438,9 +414,6 @@
"execution_count": 10,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -480,9 +453,6 @@
"execution_count": 10,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand All @@ -508,9 +478,6 @@
"execution_count": 11,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -564,9 +531,6 @@
"execution_count": 12,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -594,9 +558,6 @@
"execution_count": 13,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -636,9 +597,6 @@
"execution_count": 13,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -669,9 +627,6 @@
"execution_count": 14,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -724,9 +679,6 @@
"execution_count": 15,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -824,9 +776,6 @@
"execution_count": 16,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -867,9 +816,6 @@
"execution_count": 17,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -991,9 +937,6 @@
"execution_count": 19,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -1028,9 +971,6 @@
"execution_count": 20,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -1095,7 +1035,7 @@
"m^{\\alpha}_x(x_i)=\n",
"\\begin{cases}\n",
"\\alpha & \\mbox{ if } x_i = x\\\\\n",
"1-\\alpha & \\mbox{ if } x_i \\in \\pi(x)\\\\\n",
"\\frac{1-\\alpha}{|\\pi(x)|} & \\mbox{ if } x_i \\in \\pi(x)\\\\\n",
"0 & \\mbox{ otherwise }\n",
"\\end{cases}\n",
"\\end{equation*}\n",
Expand Down Expand Up @@ -1140,9 +1080,6 @@
"execution_count": 21,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand All @@ -1163,9 +1100,6 @@
"execution_count": 22,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -1205,9 +1139,6 @@
"execution_count": 23,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -1255,9 +1186,6 @@
"execution_count": 24,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -1305,9 +1233,6 @@
"execution_count": 25,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -1380,9 +1305,6 @@
"execution_count": 27,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
},
Expand Down

0 comments on commit 724a950

Please sign in to comment.