예제 #1
0
def test_param_dict():
    r = resolver.ParamResolver({'a': 0.5, 'b': 0.1})
    assert r.param_dict == {'a': 0.5, 'b': 0.1}
예제 #2
0
 def __iter__(self) -> Iterator[resolver.ParamResolver]:
     for params in self.param_tuples():
         yield resolver.ParamResolver(collections.OrderedDict(params))
예제 #3
0
def test_value_of():
    r = resolver.ParamResolver({'a': 0.5, 'b': 0.1})
    assert r.value_of(Symbol('a')) == 0.5
    assert r.value_of(0.5) == 0.5
    assert r.value_of(Symbol('b')) == 0.1
    assert r.value_of(0.3) == 0.3