Skip to content

Commit 18622ab

Browse files
committed
prek fixes
1 parent 8aba927 commit 18622ab

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
exclude: ^(tests/|code_to_optimize/|pie_test_set/|experiments/|\.codeflash/)
2+
13
repos:
24
- repo: https://github.com/astral-sh/ruff-pre-commit
35
rev: v0.15.8
@@ -9,7 +11,8 @@ repos:
911
hooks:
1012
- id: mypy
1113
name: mypy
12-
entry: uv run mypy --non-interactive --config-file pyproject.toml
14+
entry: uv run mypy --non-interactive --config-file pyproject.toml @mypy_allowlist.txt
1315
language: system
16+
pass_filenames: false
1417
types: [python]
1518
require_serial: true

codeflash/verification/comparator.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,7 @@ def comparator(orig: Any, new: Any, superset_obj: bool = False) -> bool:
306306
if not comparator(orig.dense_shape.numpy(), new.dense_shape.numpy(), superset_obj):
307307
return False
308308
return comparator(orig.indices.numpy(), new.indices.numpy(), superset_obj) and comparator(
309-
orig.values.numpy(),
310-
new.values.numpy(),
311-
superset_obj,
309+
orig.values.numpy(), new.values.numpy(), superset_obj
312310
)
313311

314312
if isinstance(orig, tf.RaggedTensor):
@@ -336,9 +334,7 @@ def comparator(orig: Any, new: Any, superset_obj: bool = False) -> bool:
336334
pass
337335

338336
# scipy condition because dok_matrix type is also a instance of dict, but dict comparison doesn't work for it
339-
scipy_sparse = (
340-
_optional_module("scipy.sparse") if HAS_SCIPY and _object_module_matches(orig, "scipy") else None
341-
)
337+
scipy_sparse = _optional_module("scipy.sparse") if HAS_SCIPY and _object_module_matches(orig, "scipy") else None
342338
if isinstance(orig, dict) and not (scipy_sparse is not None and isinstance(orig, scipy_sparse.spmatrix)):
343339
if superset_obj:
344340
return all(k in new and comparator(v, new[k], superset_obj) for k, v in orig.items())

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ warn_unreachable = true
218218
install_types = true
219219
plugins = ["pydantic.mypy"]
220220

221-
exclude = ["tests/", "code_to_optimize/", "pie_test_set/", "experiments/"]
221+
exclude = ["tests/", "code_to_optimize/", "pie_test_set/", "experiments/", "^\\.codeflash/"]
222222

223223
[[tool.mypy.overrides]]
224224
module = ["jedi", "jedi.api.classes", "inquirer", "inquirer.themes", "numba", "dill"]
@@ -379,4 +379,3 @@ markers = [
379379
[build-system]
380380
requires = ["hatchling", "uv-dynamic-versioning"]
381381
build-backend = "hatchling.build"
382-

0 commit comments

Comments
 (0)