MCPcopy Create free account
hub / github.com/CompPhysVienna/n2p2 / test_boundaries

Method test_boundaries

test/python/test_CutoffFunction.py:86–95  ·  view source on GitHub ↗
(self, c1, cf_type)

Source from the content-addressed store, hash-verified

84class Test_f:
85 @pytest.mark.parametrize("cf_type", cutoff_function_types)
86 def test_boundaries(self, c1, cf_type):
87 c1.setCutoffType(cf_type)
88 if cf_type not in [CutoffFunction.CT_TANHU]:
89 assert c1.f(0.0) == pytest.approx(1.0), (
90 "Wrong cutoff function value.")
91 if cf_type not in [CutoffFunction.CT_TANHU, CutoffFunction.CT_TANH]:
92 assert c1.f(cutoff_radius * cutoff_parameter) == pytest.approx(1.0), (
93 "Wrong cutoff function value.")
94 assert c1.f(cutoff_radius) == pytest.approx(0.0), (
95 "Wrong cutoff function value.")
96 @pytest.mark.parametrize("cf_type, cf_value",
97 zip(cutoff_function_types, cutoff_function_values))
98 def test_nonzero_radius(self, c1, cf_type, cf_value):

Callers

nothing calls this directly

Calls 2

setCutoffTypeMethod · 0.80
fMethod · 0.45

Tested by

no test coverage detected