eindir-core 0.5.2

Typed primitives for ND objective functions and bounded sampling.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
import numpy as np

from eindir.core.components import FPair


def test_fpair():
    def dummy_func(x):
        return np.sum(x**2)

    pos = np.array([2, 3])
    pair = FPair(pos=pos, val=0)
    pair.EvalFunc(dummy_func)
    assert pair.val == 13, "FPair.EvalFunc does not correctly evaluate the function."