Esempio n. 1
0
 def __init__(self, context_data: ContextData, attribute_product_data: AttributeProductData):
     self.entity_product_count_cache = FunctionCacheManager(self.__get_entity_product_count, 1000)
     self.context_data = context_data
     self.attribute_product_data = attribute_product_data
     self._global_weightings = {
         "brand": 100.0,
         "color": 90.0,
         "style": 80.0,
         "theme": 70.0,
         "season": 70.0,
         "detail": 60.0,
         "material": 50.0,
         "popular": 30.0,
         "added": 20.0
     }
Esempio n. 2
0
 def __init__(self, directory, file_ext=None, cache_size=None):
     self.directory = directory
     self.file_ext = file_ext
     if cache_size is not None:
         from pylru import FunctionCacheManager
         self.get = FunctionCacheManager(self.get, size=cache_size)
Esempio n. 3
0
 def __init__(self, cache_maxsize=128):
     self.reason_cache = FunctionCacheManager(self.get_reason_list,
                                              cache_maxsize)
Esempio n. 4
0
 def __init__(self, directory, file_ext=None, cache_size=None):
     """Initialize a NeuronLoader object."""
     self.directory = directory
     self.file_ext = file_ext
     if cache_size is not None:
         self.get = FunctionCacheManager(self.get, size=cache_size)