Skip to content

trying to induce new life to this repo #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ repos:
hooks:
- id: ruff
args: [ --fix ]

- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"ms-python.mypy-type-checker",
"eamodio.gitlens",
"ms-vscode.makefile-tools",
"ms-python.isort",
]
}
5 changes: 1 addition & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

// ==== Linting ===
// linter
"flake8.enabled" : false,
"isort.enabled" : false,
"ruff.enable": true,
"ruff.lint.args": [
Expand All @@ -66,14 +65,12 @@

// === Integrated terminal ====
"terminal.integrated.profiles.linux": {
// Ensure the default integrated terminal (bash) respects .bash_profile
// https://superuser.com/questions/1209366/win10-vs-code-integrated-bash-not-loading-bash-profile
"bash": {
"path": "bash",
"args": ["--init-file", "${workspaceFolder}/.vscode/start-terminal.sh"],
},
},

"terminal.integrated.defaultProfile.linux": "bash",
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"python.envFile": "${workspaceFolder}/.env",

Expand Down
2 changes: 1 addition & 1 deletion .vscode/start-terminal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Init vscode integrated terminal"

ENV_FILE=".env"
VENV_DIR=".venv/bin/activate"
VENV_DIR="./.venv/bin/activate"

if test -f ~/.bash_profile; then
echo "Running ~/.bash_profile"
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ endif
format:
@echo "formatting..."
@poetry install
# add isort
@poetry run isort .
@poetry run black .
# ruff fix
@poetry run pre-commit run --all-files --config .pre-commit-config.yaml

.PHONY: run_tests
Expand Down
2 changes: 1 addition & 1 deletion graph_ml/_ext/Trie.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# distutils: language = c++

from libcpp.string cimport string
from libcpp.list cimport list
from libcpp.string cimport string


cdef extern from "Trie.cpp":
Expand Down
1 change: 1 addition & 0 deletions graph_ml/_ext/cytrie.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from Trie cimport Trie


cdef class CyTrie:
cdef Trie c_trie;

Expand Down
3 changes: 1 addition & 2 deletions graph_ml/datasets/polbooks.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import pandas as pd
import networkx as nx
import pandas as pd
from torch_geometric.data import extract_zip


from ..datasets import dataset


Expand Down
3 changes: 2 additions & 1 deletion graph_ml/models/torch_node2vec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
from torch_geometric.nn import Node2Vec as PyGNode2Vec
import torch
from torch_geometric.nn import Node2Vec as PyGNode2Vec

from ..models.node2vec import Node2Vec


Expand Down
4 changes: 3 additions & 1 deletion graph_ml/transformations/sampler.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import random
from typing import Optional

import numpy as np
import pytorch_lightning as pl
import random

from ..utils import utils


Expand Down
1 change: 1 addition & 0 deletions graph_ml/transformations/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import numpy as np
from scipy import sparse

from ..utils import utils


Expand Down
3 changes: 2 additions & 1 deletion graph_ml/utils/config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import os
import sys

import torch
from ..utils import utils

from ..utils import utils

OS = os.name
PLATFORM = sys.platform
Expand Down
3 changes: 2 additions & 1 deletion graph_ml/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os

import numpy as np
from scipy import sparse
from numba import njit
from scipy import sparse


def get_formatted_environ_variable(name, dtype, default):
Expand Down
16 changes: 15 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ codeium-jupyter = "^1.1.21"
jupyter-contrib-nbextensions = "^0.7.0"
pre-commit = "^3.6.2"
black = "^24.2.0"
isort = "^5.13.2"


[tool.poetry.build]
Expand Down
4 changes: 3 additions & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
from graph_ml.utils import config

import pytest

from graph_ml.utils import config


@pytest.fixture()
def OS():
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cython.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from graph_ml import CyTrie
import pytest

from graph_ml import CyTrie


@pytest.fixture()
def trie():
Expand Down
5 changes: 3 additions & 2 deletions tests/test_samplers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from graph_ml.transformations import samplers
from graph_ml.datasets import polbooks
import pytest

from graph_ml.datasets import polbooks
from graph_ml.transformations import samplers


@pytest.fixture()
def dataset():
Expand Down
Loading