-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from harisankar95/code-cleanup
minor bug fixes, more tests, version bumped for release
- Loading branch information
Showing
10 changed files
with
126 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# Changelog | ||
|
||
## 0.5.1 | ||
|
||
- Minor bug fixes | ||
- More tests added | ||
|
||
## 0.5.0 | ||
|
||
- New tests added for diagonal movements | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.5.0 | ||
0.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import numpy as np | ||
import pytest | ||
|
||
from pathfinding3d.core.grid import Grid, GridNode | ||
from pathfinding3d.finder.finder import Finder | ||
from pathfinding3d.finder.msp import MinimumSpanningTree | ||
|
||
|
||
class DummyFinder(Finder): | ||
def __init__(self): | ||
super().__init__() | ||
|
||
|
||
def test_check_neighbors_raises_exception(): | ||
finder = DummyFinder() | ||
start = GridNode(0, 0, 0) | ||
end = GridNode(1, 1, 1) | ||
grid = Grid(matrix=[[[1]]]) | ||
open_list = [] | ||
|
||
with pytest.raises(NotImplementedError): | ||
finder.check_neighbors(start, end, grid, open_list) | ||
|
||
|
||
def test_msp(): | ||
""" | ||
Test that the minimum spanning tree finder returns all nodes. | ||
""" | ||
matrix = np.array(np.ones((3, 3, 3))) | ||
grid = Grid(matrix=matrix) | ||
|
||
start = grid.node(0, 0, 0) | ||
|
||
finder = MinimumSpanningTree() | ||
assert finder.tree(grid, start).sort() == [node for row in grid.nodes for col in row for node in col].sort() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters