def get_x_per_impl(self, property: StatProperty) -> t.Dict[str, t.List[float]]:
"""
Returns a list of [property] for each implementation.
:param property: property function that gets a SingleProperty object and a list of all means and returns a float
"""
means = [x.mean() for x in self.impls.values()] # type: t.List[float]
singles = [x.get_single_property() for x in self.impls.values()]
ret = InsertionTimeOrderedDict() # t.Dict[str, t.List[float]]
property_arg_number = min(len(inspect.signature(property).parameters), 4)
for (i, impl) in enumerate(self.impls):
args = [singles[i], means, singles, i]
ret[impl] = [property(*args[:property_arg_number])]
#pprint(ret._dict)
typecheck(ret._dict, Dict(key_type=Str(), value_type=List(Float()|Int()), all_keys=False))
return ret
评论列表
文章目录