diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b24026ed..6384338f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,27 +1,27 @@ repos: - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.5.1' + rev: 'v1.19.1' hooks: - id: mypy language: system pass_filenames: false args: ['legate_sparse'] - - repo: https://github.com/psf/black - rev: 23.9.1 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 25.12.0 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 7.0.0 hooks: - id: isort args: ["--profile", "black"] - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.3.0 hooks: - id: flake8 args: [--config=.flake8] - repo: https://github.com/pre-commit/mirrors-clang-format - rev: 'v16.0.6' # Use the sha / tag you want to point at + rev: 'v21.1.8' # Use the sha / tag you want to point at hooks: - id: clang-format files: \.(cu|cuh|h|cc|inl)$ diff --git a/examples/common.py b/examples/common.py index 99174ed6..c7b7b493 100644 --- a/examples/common.py +++ b/examples/common.py @@ -171,8 +171,7 @@ class DummyScope: that may or may not use resource scoping. """ - def __init__(self): - ... + def __init__(self): ... def __enter__(self): """Enter the context (no-op).""" diff --git a/examples/pde.py b/examples/pde.py index d9ca0095..9212baba 100644 --- a/examples/pde.py +++ b/examples/pde.py @@ -218,7 +218,9 @@ def execute(nx, ny, plot, plot_fname, throughput, tol, max_iters, warmup_iters, # If we're testing throughput, run only the prescribed number of iterations. if throughput: if use_legate: - p_sol, iters = linalg.cg(A, bflat, rtol=tol, maxiter=max_iters, conv_test_iters=max_iters) + p_sol, iters = linalg.cg( + A, bflat, rtol=tol, maxiter=max_iters, conv_test_iters=max_iters + ) else: p_sol, iters = linalg.cg(A, bflat, rtol=tol, maxiter=max_iters) else: diff --git a/legate_sparse/coverage.py b/legate_sparse/coverage.py index 8765044e..cfbf98aa 100644 --- a/legate_sparse/coverage.py +++ b/legate_sparse/coverage.py @@ -43,8 +43,7 @@ def should_wrap(obj: object) -> bool: class AnyCallable(Protocol): - def __call__(self, *args: Any, **kwargs: Any) -> Any: - ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def wrap(func: AnyCallable) -> Any: diff --git a/legate_sparse/module.py b/legate_sparse/module.py index 56f22fa1..e2004a60 100644 --- a/legate_sparse/module.py +++ b/legate_sparse/module.py @@ -59,6 +59,7 @@ def _is_sparse_matrix(obj) -> bool: return any((isinstance(obj, csr_array), isinstance(obj, dia_array))) + def isspmatrix(obj) -> bool: """Check if an object is a legate sparse matrix. diff --git a/scripts/memlog_analysis.py b/scripts/memlog_analysis.py index ee8bd3c6..e294c349 100644 --- a/scripts/memlog_analysis.py +++ b/scripts/memlog_analysis.py @@ -16,10 +16,10 @@ # Parse the log file allocations = parse_memlog('memlog.txt') - + # Export to CSV export_to_csv(allocations, 'memory_analysis.csv') - + # Create visualizations (requires pandas, matplotlib, seaborn) visualize_allocations(allocations) """ # noqa: W293