Skip to content

Commit

Permalink
Add multivariable function to custom library tests
Browse files Browse the repository at this point in the history
  • Loading branch information
briandesilva committed Sep 26, 2020
1 parent 6ece429 commit 0f7ca74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,18 @@ def data_derivative_2d():

@pytest.fixture
def data_custom_library():
library_functions = [lambda x: x, lambda x: x ** 2, lambda x: 0 * x]
function_names = [lambda s: str(s), lambda s: str(s) + "^2", lambda s: "0"]
library_functions = [
lambda x: x,
lambda x: x ** 2,
lambda x: 0 * x,
lambda x, y: x * y,
]
function_names = [
lambda s: str(s),
lambda s: str(s) + "^2",
lambda s: "0",
lambda s, t: str(s) + " " + str(t),
]

return CustomLibrary(
library_functions=library_functions, function_names=function_names
Expand Down
2 changes: 1 addition & 1 deletion test/feature_library/test_feature_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_change_in_data_shape(data_lorenz, library):
(PolynomialLibrary(), 10),
(IdentityLibrary() + PolynomialLibrary(), 13),
(FourierLibrary(), 6),
(pytest.lazy_fixture("data_custom_library"), 9),
(pytest.lazy_fixture("data_custom_library"), 12),
],
)
def test_output_shape(data_lorenz, library, shape):
Expand Down

0 comments on commit 0f7ca74

Please sign in to comment.