perf: avoid recalculating product dict in indexifier to improve performance for probs
This commit is contained in:
parent
093a3fb5c4
commit
60f29b0b2f
@ -31,10 +31,10 @@ class Indexifier:
|
|||||||
|
|
||||||
def __init__(self, list_dict: typing.Dict[str, typing.Sequence]):
|
def __init__(self, list_dict: typing.Dict[str, typing.Sequence]):
|
||||||
self.dict = list_dict
|
self.dict = list_dict
|
||||||
|
self.product_dict = _dict_product(self.dict)
|
||||||
|
|
||||||
def indexify(self, n: int) -> typing.Dict[str, typing.Any]:
|
def indexify(self, n: int) -> typing.Dict[str, typing.Any]:
|
||||||
product_dict = _dict_product(self.dict)
|
return self.product_dict[n]
|
||||||
return product_dict[n]
|
|
||||||
|
|
||||||
def _indexify_indices(self, n: int) -> typing.Sequence[int]:
|
def _indexify_indices(self, n: int) -> typing.Sequence[int]:
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user