Skip to content

Commit

Permalink
Fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
realshouzy committed May 9, 2024
1 parent 952574a commit c29c27d
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 35 deletions.
14 changes: 8 additions & 6 deletions nrw/algorithms/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ __all__: Final[tuple[str, ...]] = (

from typing import Final, TypeVar, overload

from nrw.datastructures._binary_search_tree import BinarySearchTree
from nrw.datastructures._binary_tree import BinaryTree
from nrw.datastructures._comparable_content import ComparableContentT
from nrw.datastructures._graph import Graph
from nrw.datastructures._list import List
from nrw.datastructures._vertex import Vertex
from nrw.datastructures import (
BinarySearchTree,
BinaryTree,
ComparableContentT,
Graph,
List,
Vertex,
)

_T = TypeVar("_T")

Expand Down
6 changes: 1 addition & 5 deletions tests/algorithms/searching_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@

import pytest

from nrw.algorithms._searching import (
breadth_first_search,
depth_first_search,
linear_search,
)
from nrw.algorithms import breadth_first_search, depth_first_search, linear_search
from nrw.datastructures import Edge, Graph, List, Vertex


Expand Down
2 changes: 1 addition & 1 deletion tests/algorithms/sorting_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest

from nrw.algorithms._sorting import (
from nrw.algorithms import (
bubble_sort,
insertion_sort,
merge_sort,
Expand Down
8 changes: 1 addition & 7 deletions tests/algorithms/traversal_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@

import pytest

from nrw.algorithms._traversal import (
inorder,
levelorder,
postorder,
preorder,
reverse_inorder,
)
from nrw.algorithms import inorder, levelorder, postorder, preorder, reverse_inorder
from nrw.datastructures import BinarySearchTree, BinaryTree

if TYPE_CHECKING:
Expand Down
3 changes: 2 additions & 1 deletion tests/datastructures/binary_search_tree_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import pytest

from nrw.datastructures._binary_search_tree import BinarySearchTree, _BSTNode
from nrw.datastructures import BinarySearchTree
from nrw.datastructures._binary_search_tree import _BSTNode


@pytest.fixture()
Expand Down
3 changes: 2 additions & 1 deletion tests/datastructures/binary_tree_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import pytest

from nrw.datastructures._binary_tree import BinaryTree, _BTNode
from nrw.datastructures import BinaryTree
from nrw.datastructures._binary_tree import _BTNode


def test_slots_of_btnode() -> None:
Expand Down
3 changes: 1 addition & 2 deletions tests/datastructures/edge_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

import pytest

from nrw.datastructures._edge import Edge
from nrw.datastructures._vertex import Vertex
from nrw.datastructures import Edge, Vertex


def test_slots_of_edge() -> None:
Expand Down
9 changes: 1 addition & 8 deletions tests/datastructures/graph_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
"""Tests for `datastructures._graph`."""
from __future__ import annotations

from typing import TYPE_CHECKING

import pytest

from nrw.datastructures._edge import Edge
from nrw.datastructures._graph import Graph
from nrw.datastructures._vertex import Vertex

if TYPE_CHECKING:
from nrw.datastructures._list import List
from nrw.datastructures import Edge, Graph, List, Vertex


@pytest.fixture()
Expand Down
3 changes: 2 additions & 1 deletion tests/datastructures/list_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import pytest

from nrw.datastructures._list import List, _ListNode
from nrw.datastructures import List
from nrw.datastructures._list import _ListNode


@pytest.fixture()
Expand Down
3 changes: 2 additions & 1 deletion tests/datastructures/queue_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import pytest

from nrw.datastructures._queue import Queue, _QueueNode
from nrw.datastructures import Queue
from nrw.datastructures._queue import _QueueNode


def test_slots_of_queue_node() -> None:
Expand Down
3 changes: 2 additions & 1 deletion tests/datastructures/stack_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import pytest

from nrw.datastructures._stack import Stack, _StackNode
from nrw.datastructures import Stack
from nrw.datastructures._stack import _StackNode


def test_slots_of_stack_node() -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/datastructures/vertex_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from nrw.datastructures._vertex import Vertex
from nrw.datastructures import Vertex


def test_slots_of_vertex() -> None:
Expand Down

0 comments on commit c29c27d

Please sign in to comment.