Skip to content

Commit

Permalink
Fix: changed fixture-name get_queries_xD to queries_xD
Browse files Browse the repository at this point in the history
  • Loading branch information
OberGue committed Apr 9, 2024
1 parent f828469 commit 06b6dd8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions test_pytest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_knotvectors_3():

# query points
@pytest.fixture
def get_queries_2D():
def queries_2D():
return [
[0.01, 0.01],
[0.01, 0.5],
Expand All @@ -106,7 +106,7 @@ def get_queries_2D():


@pytest.fixture
def get_queries_3D():
def queries_3D():
return [
[0.1, 0.1, 0.1],
[0.734, 0.525, 0.143],
Expand Down
16 changes: 8 additions & 8 deletions test_pytest/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)


def test_basis_and_support(bspline_2p2d, nurbs_2p2d, get_queries_2D):
def test_basis_and_support(bspline_2p2d, nurbs_2p2d, queries_2D):
"""Test the correct calculation of the basis functions.
(.basis_and_support())"""

Expand Down Expand Up @@ -134,12 +134,12 @@ def test_basis_and_support(bspline_2p2d, nurbs_2p2d, get_queries_2D):

# test basis functions
assert np.allclose(
bspline_2p2d.basis_and_support(get_queries_2D)[0],
bspline_2p2d.basis_and_support(queries_2D)[0],
bspline_ref_basis_functions,
)

assert np.allclose(
nurbs_2p2d.basis_and_support(get_queries_2D)[0],
nurbs_2p2d.basis_and_support(queries_2D)[0],
nurbs_ref_basis_functions,
)

Expand Down Expand Up @@ -374,18 +374,18 @@ def basis_functions_sum(basis_functions):
),
],
)
def test_evaluate(spline, reference, get_queries_2D, request):
def test_evaluate(spline, reference, queries_2D, request):
"""Test the correct spline evaluation in the physical space.
(.evaluate())"""
spline = request.getfixturevalue(spline)
# test evaluation
assert np.allclose(
spline.evaluate(get_queries_2D),
spline.evaluate(queries_2D),
reference,
)


def test_derivative(bspline_2p2d, nurbs_2p2d, get_queries_2D, np_rng):
def test_derivative(bspline_2p2d, nurbs_2p2d, queries_2D, np_rng):
"""Test the correct calculation of the first derivative.
(.derivative())"""

Expand Down Expand Up @@ -414,12 +414,12 @@ def test_derivative(bspline_2p2d, nurbs_2p2d, get_queries_2D, np_rng):

# test derivative evaluation
assert np.allclose(
bspline_2p2d.derivative(get_queries_2D, o1),
bspline_2p2d.derivative(queries_2D, o1),
bspline_ref_derivative,
)

assert np.allclose(
nurbs_2p2d.derivative(get_queries_2D, o1),
nurbs_2p2d.derivative(queries_2D, o1),
nurbs_ref_derivative,
)

Expand Down
6 changes: 3 additions & 3 deletions test_pytest/test_reparametrize.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@pytest.mark.parametrize("splinetype", all_3p3d_splines)
def test_permute_parametric_axes(request, splinetype, get_queries_3D):
def test_permute_parametric_axes(request, splinetype, queries_3D):
"""
test permute
"""
Expand All @@ -36,7 +36,7 @@ def test_permute_parametric_axes(request, splinetype, get_queries_3D):
perm = splinepy.helpme.reparametrize.permute_parametric_axes(
spline, permutation, inplace=False
)
queries = np.asarray(get_queries_3D)
queries = np.asarray(queries_3D)

assert np.allclose(
spline.evaluate(queries),
Expand All @@ -48,7 +48,7 @@ def test_permute_parametric_axes(request, splinetype, get_queries_3D):
splinepy.helpme.reparametrize.permute_parametric_axes(
perm, permutation, inplace=True
)
queries = np.asarray(get_queries_3D)
queries = np.asarray(queries_3D)

assert np.allclose(
spline.evaluate(queries),
Expand Down

0 comments on commit 06b6dd8

Please sign in to comment.