MCPcopy Index your code
hub / github.com/YuminosukeSato/ironkernel / test_sqrt_abs_sin

Method test_sqrt_abs_sin

tests/python/test_kernel.py:76–82  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

74
75class TestMathFunctions:
76 def test_sqrt_abs_sin(self) -> None:
77 x = kernel.arg("x")
78 transform = kernel.elementwise(kernel.sqrt(kernel.abs(x)) + kernel.sin(x))
79 bx = rt.asarray(np.array([4.0, 9.0]))
80 out = rt.go(kernel.map(transform, x=bx)).result().numpy()
81 assert abs(out[0] - (math.sqrt(4.0) + math.sin(4.0))) < 1e-10
82 assert abs(out[1] - (math.sqrt(9.0) + math.sin(9.0))) < 1e-10
83
84 def test_log_exp(self) -> None:
85 x = kernel.arg("x")

Callers

nothing calls this directly

Calls 10

numpyMethod · 0.80
argMethod · 0.45
elementwiseMethod · 0.45
sqrtMethod · 0.45
absMethod · 0.45
sinMethod · 0.45
asarrayMethod · 0.45
resultMethod · 0.45
goMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected