-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
vg.compat
forward-compatibilty layer for libraries (#158)
Closes #112
- Loading branch information
1 parent
636b11d
commit 900413e
Showing
5 changed files
with
69 additions
and
45 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
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,21 @@ | ||
import numpy as np | ||
import pytest | ||
import vg.compat.v1 as vg | ||
|
||
|
||
def test_v1_has_functions(): | ||
np.testing.assert_array_equal( | ||
vg.normalize(np.array([5, 0, 0])), np.array([1, 0, 0]) | ||
) | ||
|
||
|
||
def test_v1_has_constants(): | ||
np.testing.assert_array_equal(vg.basis.x, np.array([1, 0, 0])) | ||
|
||
|
||
def test_v1_orient_is_alias_for_aligned_with(): | ||
v1 = np.array([1.0, 2.0, 3.0]) | ||
with pytest.deprecated_call(): | ||
np.testing.assert_array_equal( | ||
vg.orient(v1, along=vg.basis.z), vg.aligned_with(v1, along=vg.basis.z) | ||
) |
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 @@ | ||
from ..core import * # noqa: F401, F403 |