-
Notifications
You must be signed in to change notification settings - Fork 60
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 #57 from ndem0/coverage
Increase coverage
- Loading branch information
Showing
10 changed files
with
195 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ================================================= # | ||
# Mu file # | ||
# ================================================= # | ||
|
||
# Lines starting with '#' are comments, they will be ignored. | ||
|
||
# mu0 mu1 file | ||
tests/test_datasets/matlab_00.vtk | ||
tests/test_datasets/matlab_01.vtk | ||
tests/test_datasets/matlab_02.vtk | ||
tests/test_datasets/matlab_03.vtk |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from unittest import TestCase | ||
import unittest | ||
import numpy as np | ||
import filecmp | ||
import os | ||
import sys | ||
from ezyrb.ndinterpolator.rbf import RBFInterpolator | ||
|
||
|
||
class TestRBFInterpolator(TestCase): | ||
def test_rbf(self): | ||
pts = np.eye(3) | ||
values = np.arange(15).reshape(3, 5) | ||
space = RBFInterpolator(pts, values) | ||
|
||
def test_points(self): | ||
pts = np.eye(3) | ||
values = np.arange(15).reshape(3, 5) | ||
space = RBFInterpolator(pts, values) | ||
np.testing.assert_array_equal(space.points, pts) | ||
|
||
def test_default_basis(self): | ||
pts = np.eye(3) | ||
values = np.arange(15).reshape(3, 5) | ||
space = RBFInterpolator(pts, values) | ||
assert space.basis == RBFInterpolator.multi_quadratic | ||
|
||
def test_default_radius(self): | ||
pts = np.eye(3) | ||
values = np.arange(15).reshape(3, 5) | ||
space = RBFInterpolator(pts, values) | ||
assert space.radius == 1.0 | ||
|
||
def test_multi_quadratic(self): | ||
func_res = RBFInterpolator.multi_quadratic(np.linspace(0, 1, 5), .5) | ||
exct_res = np.array([0.5, 0.559017, 0.707107, 0.901388, 1.118034]) | ||
np.testing.assert_array_almost_equal(func_res, exct_res, decimal=6) | ||
|
||
def test_default_call(self): | ||
pts = np.eye(3) | ||
values = np.arange(15).reshape(3, 5) | ||
space = RBFInterpolator(pts, values) | ||
exct_res = np.array([ | ||
[ 4.75195353, 5.70234424, 6.65273494, 7.60312565, 8.55351636] | ||
]) | ||
np.testing.assert_array_almost_equal( | ||
space([[0, 0, 0]]), exct_res, decimal=6) |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from unittest import TestCase | ||
import unittest | ||
import numpy as np | ||
import filecmp | ||
import os | ||
|
||
from ezyrb.parametricspace import ParametricSpace | ||
|
||
class TestParametricSpace(TestCase): | ||
def test_init(self): | ||
with self.assertRaises(NotImplementedError): | ||
ParametricSpace() | ||
|
||
def test_call(self): | ||
with self.assertRaises(NotImplementedError): | ||
ParametricSpace()(0.0) |
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