1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-12 15:26:54 +08:00

black format

This commit is contained in:
hadrianl
2020-12-22 10:54:13 +08:00
committed by you-n-g
parent 4c4f0f3c5e
commit 40bbafcaab

View File

@@ -47,12 +47,8 @@ class MemCacheUnit(abc.ABC):
self.size_limit = kwargs.pop("size_limit", 0) self.size_limit = kwargs.pop("size_limit", 0)
self.limit_type = kwargs.pop("limit_type", "length") self.limit_type = kwargs.pop("limit_type", "length")
assert self.limit_type in ["length", "sizeof"], ValueError( assert self.limit_type in ["length", "sizeof"], ValueError("limit_type shoule be one of ['length', 'sizeof']")
"limit_type shoule be one of ['length', 'sizeof']" assert self.size_limit >= 0, ValueError("size_limit shoule not be negative.The default 0 means unlimited!")
)
assert self.size_limit >= 0, ValueError(
"size_limit shoule not be negative.The default 0 means unlimited!"
)
# limit_flag: whether to popitem or not # limit_flag: whether to popitem or not
self._limit_flag = 1 if self.size_limit > 0 else 0 self._limit_flag = 1 if self.size_limit > 0 else 0