def test_param_dict(): r = resolver.ParamResolver({'a': 0.5, 'b': 0.1}) assert r.param_dict == {'a': 0.5, 'b': 0.1}
def __iter__(self) -> Iterator[resolver.ParamResolver]: for params in self.param_tuples(): yield resolver.ParamResolver(collections.OrderedDict(params))
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