Skip to content

Commit

Permalink
enable 'tch' rules
Browse files Browse the repository at this point in the history
  • Loading branch information
darthtrevino committed May 10, 2024
1 parent c9162c1 commit 9656575
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
7 changes: 4 additions & 3 deletions graspologic/embed/mds.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.

from typing import Any, Optional, Union
from typing import TYPE_CHECKING, Any, Optional, Union

import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils import check_array
from typing_extensions import Literal

from graspologic.types import Tuple

from ..utils import is_symmetric
from .svd import SvdAlgorithmType, select_svd

if TYPE_CHECKING:
from graspologic.types import Tuple


def _get_centering_matrix(n: int) -> np.ndarray:
"""
Expand Down
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ _format_code = "ruff format . --preview"
static_checks = 'ruff check . --preview'
clean = "rm -rf docs/_build"
type_check = "mypy ./graspologic"
fix = "ruff --preview check --fix ."
fix_unsafe = "ruff check --preview --fix --unsafe-fixes ."

# Formatting
format = ['_sort_imports', '_format_code']
Expand Down Expand Up @@ -127,20 +129,20 @@ select = [
# "S",
# "G",
# "ERA",
# "ASYNC",
"ASYNC",
# "TID",
# "UP",
# "SLF",
# "BLE",
# "C4",
# "I",
"I",
# "F",
# "A",
# "ARG",
# "PTH",
# "RUF",
# "B",
# "TCH",
"TCH",
# "DTZ",
# "PYI",
#"PT",
Expand Down Expand Up @@ -170,7 +172,7 @@ ignore = [
]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S", "D", "ANN", "T201", "ASYNC", "ARG", "PTH", "TRY"]
"tests/*" = ["S", "D", "ANN", "T201", "ASYNC", "ARG", "PTH", "TRY", "SLF"]
"docs/*" = ["INP001"]
"*.ipynb" = ["T201"]

Expand Down
5 changes: 4 additions & 1 deletion tests/test_n2v.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
# Licensed under the MIT License.

import unittest
from typing import TYPE_CHECKING

import networkx as nx
import numpy as np

import graspologic.embed.n2v as n2v
from graspologic.embed.n2v import _Node2VecGraph

if TYPE_CHECKING:
import numpy as np


class Node2VecEmbedTest(unittest.TestCase):
def test_node2vec_embedding_correct_shape_is_returned(self):
Expand Down

0 comments on commit 9656575

Please sign in to comment.