From dbb50a5b964ae1caf945e026f186292f05316cac Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 17 Sep 2024 15:58:01 -0500 Subject: [PATCH] Update to flake8 7.1.1. (#1385) We need to update flake8 to fix a false-positive that appears with older flake8 versions on Python 3.12. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - James Lamb (https://github.com/jameslamb) - Benjamin Zaitlen (https://github.com/quasiben) - Peter Andreas Entschev (https://github.com/pentschev) URL: https://github.com/rapidsai/dask-cuda/pull/1385 --- .pre-commit-config.yaml | 2 +- dask_cuda/benchmarks/utils.py | 2 +- dask_cuda/cli.py | 9 +++++---- dask_cuda/tests/test_gds.py | 2 +- dask_cuda/tests/test_proxify_host_file.py | 2 +- dask_cuda/tests/test_proxy.py | 10 +++++----- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1157be19..4707492ac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: hooks: - id: black - repo: https://github.com/PyCQA/flake8 - rev: 3.8.3 + rev: 7.1.1 hooks: - id: flake8 - repo: https://github.com/codespell-project/codespell diff --git a/dask_cuda/benchmarks/utils.py b/dask_cuda/benchmarks/utils.py index 5b9448d48..de7e2ae1d 100644 --- a/dask_cuda/benchmarks/utils.py +++ b/dask_cuda/benchmarks/utils.py @@ -772,7 +772,7 @@ def print_throughput_bandwidth( ) print_key_value( key="Wall clock", - value=f"{format_time(durations.mean())} +/- {format_time(durations.std()) }", + value=f"{format_time(durations.mean())} +/- {format_time(durations.std())}", ) if not args.no_show_p2p_bandwidth: print_separator(separator="=") diff --git a/dask_cuda/cli.py b/dask_cuda/cli.py index 6a3518e07..a8c6d972c 100644 --- a/dask_cuda/cli.py +++ b/dask_cuda/cli.py @@ -167,10 +167,11 @@ def cuda(): @click.option( "--rmm-release-threshold", default=None, - help="""When ``rmm.async`` is ``True`` and the pool size grows beyond this value, unused - memory held by the pool will be released at the next synchronization point. Can be - an integer (bytes), float (fraction of total device memory), string (like ``"5GB"`` - or ``"5000M"``) or ``None``. By default, this feature is disabled. + help="""When ``rmm.async`` is ``True`` and the pool size grows beyond this + value, unused memory held by the pool will be released at the next + synchronization point. Can be an integer (bytes), float (fraction of total + device memory), string (like ``"5GB"`` or ``"5000M"``) or ``None``. By + default, this feature is disabled. .. note:: This size is a per-worker configuration, and not cluster-wide.""", diff --git a/dask_cuda/tests/test_gds.py b/dask_cuda/tests/test_gds.py index c86670252..262369e64 100644 --- a/dask_cuda/tests/test_gds.py +++ b/dask_cuda/tests/test_gds.py @@ -38,7 +38,7 @@ def test_gds(gds_enabled, cuda_lib): a = data_create() header, frames = serialize(a, serializers=("disk",)) b = deserialize(header, frames) - assert type(a) == type(b) + assert type(a) is type(b) assert data_compare(a, b) finally: ProxifyHostFile.register_disk_spilling() # Reset disk spilling options diff --git a/dask_cuda/tests/test_proxify_host_file.py b/dask_cuda/tests/test_proxify_host_file.py index 2683ea36d..56fe7f8d6 100644 --- a/dask_cuda/tests/test_proxify_host_file.py +++ b/dask_cuda/tests/test_proxify_host_file.py @@ -252,7 +252,7 @@ def task(x): assert "ProxyObject" in str(type(x)) assert x._pxy_get().serializer == "dask" else: - assert type(x) == cudf.DataFrame + assert type(x) is cudf.DataFrame assert len(x) == 10 # Trigger deserialization return x diff --git a/dask_cuda/tests/test_proxy.py b/dask_cuda/tests/test_proxy.py index 31a9e9962..90b84e90d 100644 --- a/dask_cuda/tests/test_proxy.py +++ b/dask_cuda/tests/test_proxy.py @@ -114,7 +114,7 @@ def test_proxy_object_of_array(serializers, backend): pxy = proxy_object.asproxy(org.copy(), serializers=serializers) expect = op(org) got = op(pxy) - assert type(expect) == type(got) + assert type(expect) is type(got) assert expect == got # Check unary operators @@ -124,7 +124,7 @@ def test_proxy_object_of_array(serializers, backend): pxy = proxy_object.asproxy(org.copy(), serializers=serializers) expect = op(org) got = op(pxy) - assert type(expect) == type(got) + assert type(expect) is type(got) assert all(expect == got) # Check binary operators that takes a scalar as second argument @@ -134,7 +134,7 @@ def test_proxy_object_of_array(serializers, backend): pxy = proxy_object.asproxy(org.copy(), serializers=serializers) expect = op(org, 2) got = op(pxy, 2) - assert type(expect) == type(got) + assert type(expect) is type(got) assert all(expect == got) # Check binary operators @@ -192,7 +192,7 @@ def test_proxy_object_of_array(serializers, backend): pxy = proxy_object.asproxy(org.copy(), serializers=serializers) expect = op(org) got = op(pxy) - assert type(expect) == type(got) + assert type(expect) is type(got) assert expect == got # Check reflected methods @@ -297,7 +297,7 @@ def task(x): assert "ProxyObject" in str(type(x)) assert x._pxy_get().serializer == "dask" else: - assert type(x) == cudf.DataFrame + assert type(x) is cudf.DataFrame assert len(x) == 10 # Trigger deserialization return x