Skip to content

Commit a875548

Browse files
authored
Merge pull request #8 from thunderock/ashutosh/fix_repo_setup
trying to induce new life to this repo
2 parents 8b56c6d + f38ceb4 commit a875548

18 files changed

+47
-18
lines changed

.pre-commit-config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@ repos:
1919
hooks:
2020
- id: ruff
2121
args: [ --fix ]
22+
23+
- repo: https://github.com/pre-commit/mirrors-isort
24+
rev: v5.10.1
25+
hooks:
26+
- id: isort

.vscode/extensions.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"ms-python.mypy-type-checker",
1010
"eamodio.gitlens",
1111
"ms-vscode.makefile-tools",
12+
"ms-python.isort",
1213
]
1314
}

.vscode/settings.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
// ==== Linting ===
4444
// linter
45-
"flake8.enabled" : false,
4645
"isort.enabled" : false,
4746
"ruff.enable": true,
4847
"ruff.lint.args": [
@@ -66,14 +65,12 @@
6665

6766
// === Integrated terminal ====
6867
"terminal.integrated.profiles.linux": {
69-
// Ensure the default integrated terminal (bash) respects .bash_profile
70-
// https://superuser.com/questions/1209366/win10-vs-code-integrated-bash-not-loading-bash-profile
7168
"bash": {
7269
"path": "bash",
7370
"args": ["--init-file", "${workspaceFolder}/.vscode/start-terminal.sh"],
7471
},
7572
},
76-
73+
"terminal.integrated.defaultProfile.linux": "bash",
7774
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
7875
"python.envFile": "${workspaceFolder}/.env",
7976

.vscode/start-terminal.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
echo "Init vscode integrated terminal"
44

55
ENV_FILE=".env"
6-
VENV_DIR=".venv/bin/activate"
6+
VENV_DIR="./.venv/bin/activate"
77

88
if test -f ~/.bash_profile; then
99
echo "Running ~/.bash_profile"

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ endif
2727
format:
2828
@echo "formatting..."
2929
@poetry install
30+
# add isort
31+
@poetry run isort .
3032
@poetry run black .
31-
# ruff fix
3233
@poetry run pre-commit run --all-files --config .pre-commit-config.yaml
3334

3435
.PHONY: run_tests

graph_ml/_ext/Trie.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# distutils: language = c++
22

3-
from libcpp.string cimport string
43
from libcpp.list cimport list
4+
from libcpp.string cimport string
55

66

77
cdef extern from "Trie.cpp":

graph_ml/_ext/cytrie.pyx

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from Trie cimport Trie
44

5+
56
cdef class CyTrie:
67
cdef Trie c_trie;
78

graph_ml/datasets/polbooks.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import pandas as pd
21
import networkx as nx
2+
import pandas as pd
33
from torch_geometric.data import extract_zip
44

5-
65
from ..datasets import dataset
76

87

graph_ml/models/torch_node2vec.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import numpy as np
2-
from torch_geometric.nn import Node2Vec as PyGNode2Vec
32
import torch
3+
from torch_geometric.nn import Node2Vec as PyGNode2Vec
4+
45
from ..models.node2vec import Node2Vec
56

67

graph_ml/transformations/sampler.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import random
12
from typing import Optional
3+
24
import numpy as np
35
import pytorch_lightning as pl
4-
import random
6+
57
from ..utils import utils
68

79

graph_ml/transformations/samplers.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import numpy as np
1010
from scipy import sparse
11+
1112
from ..utils import utils
1213

1314

graph_ml/utils/config.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import os
22
import sys
3+
34
import torch
4-
from ..utils import utils
55

6+
from ..utils import utils
67

78
OS = os.name
89
PLATFORM = sys.platform

graph_ml/utils/utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import os
2+
23
import numpy as np
3-
from scipy import sparse
44
from numba import njit
5+
from scipy import sparse
56

67

78
def get_formatted_environ_variable(name, dtype, default):

poetry.lock

+15-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ codeium-jupyter = "^1.1.21"
4949
jupyter-contrib-nbextensions = "^0.7.0"
5050
pre-commit = "^3.6.2"
5151
black = "^24.2.0"
52+
isort = "^5.13.2"
5253

5354

5455
[tool.poetry.build]

tests/test_config.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import os
2-
from graph_ml.utils import config
2+
33
import pytest
44

5+
from graph_ml.utils import config
6+
57

68
@pytest.fixture()
79
def OS():

tests/test_cython.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from graph_ml import CyTrie
21
import pytest
32

3+
from graph_ml import CyTrie
4+
45

56
@pytest.fixture()
67
def trie():

tests/test_samplers.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from graph_ml.transformations import samplers
2-
from graph_ml.datasets import polbooks
31
import pytest
42

3+
from graph_ml.datasets import polbooks
4+
from graph_ml.transformations import samplers
5+
56

67
@pytest.fixture()
78
def dataset():

0 commit comments

Comments
 (0)