mirror of https://github.com/Mai-with-u/MaiBot.git
Ruff fix x3 final fix
parent
163d527f3c
commit
ed68f969c1
|
|
@ -97,7 +97,7 @@ def _compute_weights(population: List[Dict]) -> List[float]:
|
|||
|
||||
# 如果checked,权重乘以3
|
||||
weights = []
|
||||
for base_weight, checked in zip(base_weights, checked_flags):
|
||||
for base_weight, checked in zip(base_weights, checked_flags, strict=False):
|
||||
if checked:
|
||||
weights.append(base_weight * 3.0)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class ExpressionReflector:
|
|||
try:
|
||||
logger.info("[Expression Reflection] 查询未检查且未拒绝的表达")
|
||||
expressions = (
|
||||
Expression.select().where((Expression.checked == False) & (Expression.rejected == False)).limit(50)
|
||||
Expression.select().where((~Expression.checked) & (~Expression.rejected)).limit(50)
|
||||
)
|
||||
|
||||
expr_list = list(expressions)
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class ExpressionSelector:
|
|||
|
||||
# 优化:一次性查询所有相关chat_id的表达方式,排除 rejected=1 的表达
|
||||
style_query = Expression.select().where(
|
||||
(Expression.chat_id.in_(related_chat_ids)) & (Expression.rejected == False)
|
||||
(Expression.chat_id.in_(related_chat_ids)) & (~Expression.rejected)
|
||||
)
|
||||
|
||||
style_exprs = [
|
||||
|
|
|
|||
|
|
@ -83,19 +83,19 @@ class ConfigField:
|
|||
return self.input_type
|
||||
|
||||
# 根据 type 和 choices 自动推断
|
||||
if self.type == bool:
|
||||
if self.type is bool:
|
||||
return "switch"
|
||||
elif self.type in (int, float):
|
||||
if self.min is not None and self.max is not None:
|
||||
return "slider"
|
||||
return "number"
|
||||
elif self.type == str:
|
||||
elif self.type is str:
|
||||
if self.choices:
|
||||
return "select"
|
||||
return "text"
|
||||
elif self.type == list:
|
||||
elif self.type is list:
|
||||
return "list"
|
||||
elif self.type == dict:
|
||||
elif self.type is dict:
|
||||
return "json"
|
||||
else:
|
||||
return "text"
|
||||
|
|
|
|||
Loading…
Reference in New Issue