Skip to content

Commit 18f565f

Browse files
authored
Add ruff rules for flake8-simplify (#549)
1 parent 3e39f10 commit 18f565f

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

libs/knowledge-graph/ragstack_knowledge_graph/render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def render_graph_documents(
3636

3737
def _node_id(node: Node) -> int:
3838
node_key = (node.id, node.type)
39-
if node_id := nodes.get(node_key, None):
39+
if node_id := nodes.get(node_key):
4040
return node_id
4141
else:
4242
node_id = f"{len(nodes)}"

libs/ragulate/ragstack_ragulate/analysis.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ def output_box_plots_by_dataset(self, df: DataFrame, metrics: List[str]):
8989

9090
for dataset in datasets:
9191
fig = go.Figure()
92-
test_index = 0
93-
for recipe in recipes:
92+
for test_index, recipe in enumerate(recipes):
9493
y = []
9594
x = []
9695
q1 = []
@@ -124,7 +123,6 @@ def output_box_plots_by_dataset(self, df: DataFrame, metrics: List[str]):
124123
boxpoints=False, # Do not show individual points
125124
)
126125
)
127-
test_index += 1
128126

129127
fig.update_traces(
130128
orientation="h",

libs/ragulate/ragstack_ragulate/cli_commands/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def call_run(config_file: str, **kwargs):
8080
for query_pipeline in query_pipelines:
8181
query_pipeline.query()
8282

83-
recipe_names = [n for n in config.recipes.keys()]
83+
recipe_names = config.recipes.keys()
8484

8585
analysis = Analysis()
8686
analysis.compare(recipes=recipe_names)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ select = [
6767
"F",
6868
"FLY",
6969
"I",
70-
"ISC",
7170
"N",
7271
"NPY",
7372
"PERF",
73+
"SIM",
7474
"UP",
7575
"W",
7676
]

0 commit comments

Comments
 (0)