Skip to content

Commit 05ad1fd

Browse files
Merge pull request #753 from IntelPython/update-python-style-workflow
Use black@stable, bring source to black compliance
2 parents 8b17f1c + 7dd62c1 commit 05ad1fd

File tree

8 files changed

+15
-10
lines changed

8 files changed

+15
-10
lines changed

.github/workflows/python_style_checks.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ jobs:
2525
# The type of runner that the job will run on
2626
runs-on: ubuntu-latest
2727

28+
strategy:
29+
matrix:
30+
python-version: [3.9]
31+
2832
# Steps represent a sequence of tasks that will be executed as part of the job
2933
steps:
3034
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
@@ -33,16 +37,17 @@ jobs:
3337
- uses: actions/setup-python@v2
3438

3539
# Run black code formatter
36-
- uses: psf/black@21.4b2
40+
- uses: psf/black@stable
3741
with:
38-
args: ". --check"
42+
src: "."
43+
options: "--check"
3944

4045
flake8:
4146
runs-on: ubuntu-latest
4247

4348
strategy:
4449
matrix:
45-
python-version: [3.7]
50+
python-version: [3.9]
4651

4752
steps:
4853
- uses: actions/checkout@v2

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
- id: end-of-file-fixer
1414
- id: trailing-whitespace
1515
- repo: https://github.com/psf/black
16-
rev: 21.10b0
16+
rev: 22.1.0
1717
hooks:
1818
- id: black
1919
exclude: "versioneer.py|dpctl/_version.py"

dpctl/tests/test_sycl_event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def test_sycl_timer():
202202
# device task
203203
m1.copy_from_device(m2)
204204
# host task
205-
[x ** 2 for x in range(1024)]
205+
[x**2 for x in range(1024)]
206206
host_dt, device_dt = timer.dt
207207
assert host_dt > device_dt
208208
q_no_profiling = dpctl.SyclQueue()

examples/cython/sycl_buffer/bench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import dpctl
2323

24-
X = np.full((10 ** 4, 4098), 1e-4, dtype="d")
24+
X = np.full((10**4, 4098), 1e-4, dtype="d")
2525

2626
# warm-up
2727
print("=" * 10 + " Executing warm-up " + "=" * 10)

examples/cython/sycl_direct_linkage/bench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import numpy as np
2020
import syclbuffer_naive as sb
2121

22-
X = np.full((10 ** 4, 4098), 1e-4, dtype="d")
22+
X = np.full((10**4, 4098), 1e-4, dtype="d")
2323

2424
# warm-up
2525
print("=" * 10 + " Executing warm-up " + "=" * 10)

examples/cython/usm_memory/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def gen_option_params(
6161
np.allclose(Xgpu, X_ref, atol=1e-5),
6262
)
6363

64-
n_opts = 3 * 10 ** 6
64+
n_opts = 3 * 10**6
6565

6666
# compute on CPU sycl device
6767

examples/pybind11/use_dpctl_syclqueue/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
print("")
3737
print("Computing modular reduction using SYCL on a NumPy array")
3838

39-
X = np.random.randint(low=1, high=2 ** 16 - 1, size=10 ** 6, dtype=np.longlong)
39+
X = np.random.randint(low=1, high=2**16 - 1, size=10**6, dtype=np.longlong)
4040
modulus_p = 347
4141

4242
Y = eg.offloaded_array_mod(

examples/python/usm_memory_host_access.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# populate buffer from host one byte at a type
3535
for i in range(len(ms)):
3636
ir = i % 256
37-
msv[i] = ir ** 2 % 256
37+
msv[i] = ir**2 % 256
3838

3939
mh = dpmem.MemoryUSMHost(64)
4040
mhv = memoryview(mh)

0 commit comments

Comments
 (0)