-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjustments on tests and parameter validation
- Loading branch information
1 parent
dc41684
commit f4824f6
Showing
8 changed files
with
115 additions
and
40 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
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
Empty file.
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,41 @@ | ||
import numpy as np | ||
import numpy.testing as npt | ||
from fury.texture.utils import uv_calculations | ||
|
||
def test_uv_calculations(): | ||
uv_coords = uv_calculations(1) | ||
expected_uv1 = np.array([ | ||
[0.001, 0.001], [0.001, 0.999], [0.999, 0.999], [0.999, 0.001], | ||
[0.001, 0.001], [0.001, 0.999], [0.999, 0.999], [0.999, 0.001] | ||
]) | ||
npt.assert_array_almost_equal(uv_coords, expected_uv1, decimal=3) | ||
|
||
uv_coords = uv_calculations(3) | ||
expected_uv3 = np.array([ | ||
[0.001, 0.667], [0.001, 0.999], [0.999, 0.999], [0.999, 0.667], | ||
[0.001, 0.667], [0.001, 0.999], [0.999, 0.999], [0.999, 0.667], | ||
[0.001, 0.334], [0.001, 0.665], [0.999, 0.665], [0.999, 0.334], | ||
[0.001, 0.334], [0.001, 0.665], [0.999, 0.665], [0.999, 0.334], | ||
[0.001, 0.001], [0.001, 0.332], [0.999, 0.332], [0.999, 0.001], | ||
[0.001, 0.001], [0.001, 0.332], [0.999, 0.332], [0.999, 0.001] | ||
]) | ||
npt.assert_array_almost_equal(uv_coords, expected_uv3, decimal=3) | ||
|
||
uv_coords = uv_calculations(7) | ||
expected_uv7 = np.array([ | ||
[0.001, 0.858], [0.001, 0.999], [0.999, 0.999], [0.999, 0.858], | ||
[0.001, 0.858], [0.001, 0.999], [0.999, 0.999], [0.999, 0.858], | ||
[0.001, 0.715], [0.001, 0.856], [0.999, 0.856], [0.999, 0.715], | ||
[0.001, 0.715], [0.001, 0.856], [0.999, 0.856], [0.999, 0.715], | ||
[0.001, 0.572], [0.001, 0.713], [0.999, 0.713], [0.999, 0.572], | ||
[0.001, 0.572], [0.001, 0.713], [0.999, 0.713], [0.999, 0.572], | ||
[0.001, 0.429], [0.001, 0.570], [0.999, 0.570], [0.999, 0.429], | ||
[0.001, 0.429], [0.001, 0.570], [0.999, 0.570], [0.999, 0.429], | ||
[0.001, 0.286], [0.001, 0.427], [0.999, 0.427], [0.999, 0.286], | ||
[0.001, 0.286], [0.001, 0.427], [0.999, 0.427], [0.999, 0.286], | ||
[0.001, 0.143], [0.001, 0.284], [0.999, 0.284], [0.999, 0.143], | ||
[0.001, 0.143], [0.001, 0.284], [0.999, 0.284], [0.999, 0.143], | ||
[0.001, 0.001], [0.001, 0.141], [0.999, 0.141], [0.999, 0.001], | ||
[0.001, 0.001], [0.001, 0.141], [0.999, 0.141], [0.999, 0.001] | ||
]) | ||
npt.assert_array_almost_equal(uv_coords, expected_uv7, decimal=3) |
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