Skip to content

Commit

Permalink
chore(deps): pre-commit autoupdate (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] authored Jan 14, 2025
1 parent ef5f47e commit f08d8b8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
- id: ruff
- id: ruff-format
2 changes: 1 addition & 1 deletion docs/applications/design_space_exploration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
"outputs": [],
"source": [
"def recommend_charts(\n",
" spec: list[str], draco: drc.Draco, num: int = 5, labeler=lambda i: f\"CHART {i+1}\"\n",
" spec: list[str], draco: drc.Draco, num: int = 5, labeler=lambda i: f\"CHART {i + 1}\"\n",
") -> dict[str, tuple[list[str], dict]]:\n",
" # Dictionary to store the generated recommendations, keyed by chart name\n",
" chart_specs = {}\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/applications/draco_learn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@
"\n",
" for pair in json_data:\n",
" pair[\"source\"] = \"saket_2018\"\n",
" pair[\"pair_id\"] = f'{pair[\"source\"]}_{i}'\n",
" pair[\"pair_id\"] = f\"{pair['source']}_{i}\"\n",
" learn_data[pair[\"pair_id\"]] = pair\n",
" i += 1\n",
"\n",
"data = pairs_to_vec(learn_data)\n",
"\n",
"assert set(data.negative.columns) == set(\n",
" default_draco.soft_constraint_names\n",
"), \"Feature names do not match.\""
"assert set(data.negative.columns) == set(default_draco.soft_constraint_names), (\n",
" \"Feature names do not match.\"\n",
")"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions draco/draco.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ def to_string(prog: Program | str):
soft_constraints.remove("__preamble__")
weight_keys = set(self.soft_constraint_names)

assert (
soft_constraints == weight_keys
), "Weights dictionary does not match soft constraints"
assert soft_constraints == weight_keys, (
"Weights dictionary does not match soft constraints"
)

def check_spec(self, spec: Specification) -> bool:
"""Checks the spec against the hard constraints.
Expand Down
8 changes: 4 additions & 4 deletions draco/tests/test_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

for pair in json_data:
pair["source"] = "saket_2018"
pair["pair_id"] = f'{pair["source"]}_{i}'
pair["pair_id"] = f"{pair['source']}_{i}"
learn_data[pair["pair_id"]] = pair
i += 1

Expand Down Expand Up @@ -54,6 +54,6 @@ def test_count_preferences_memoized() -> None:
def test_pairs_to_vecs() -> None:
data: pd.DataFrame = pairs_to_vec(learn_data)

assert set(data.negative.columns) == set(
draco.soft_constraint_names
), "Feature names do not match."
assert set(data.negative.columns) == set(draco.soft_constraint_names), (
"Feature names do not match."
)
2 changes: 1 addition & 1 deletion draco/tests/test_learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

for pair in json_data:
pair["source"] = "saket_2018"
pair["pair_id"] = f'{pair["source"]}_{i}'
pair["pair_id"] = f"{pair['source']}_{i}"
learn_data[pair["pair_id"]] = pair
i += 1

Expand Down

0 comments on commit f08d8b8

Please sign in to comment.