Skip to content

Use black@stable, bring source to black compliance #753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/python_style_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.9]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand All @@ -33,16 +37,17 @@ jobs:
- uses: actions/setup-python@v2

# Run black code formatter
- uses: psf/black@21.4b2
- uses: psf/black@stable
with:
args: ". --check"
src: "."
options: "--check"

flake8:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.7]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 21.10b0
rev: 22.1.0
hooks:
- id: black
exclude: "versioneer.py|dpctl/_version.py"
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tests/test_sycl_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def test_sycl_timer():
# device task
m1.copy_from_device(m2)
# host task
[x ** 2 for x in range(1024)]
[x**2 for x in range(1024)]
host_dt, device_dt = timer.dt
assert host_dt > device_dt
q_no_profiling = dpctl.SyclQueue()
Expand Down
2 changes: 1 addition & 1 deletion examples/cython/sycl_buffer/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import dpctl

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

# warm-up
print("=" * 10 + " Executing warm-up " + "=" * 10)
Expand Down
2 changes: 1 addition & 1 deletion examples/cython/sycl_direct_linkage/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import numpy as np
import syclbuffer_naive as sb

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

# warm-up
print("=" * 10 + " Executing warm-up " + "=" * 10)
Expand Down
2 changes: 1 addition & 1 deletion examples/cython/usm_memory/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def gen_option_params(
np.allclose(Xgpu, X_ref, atol=1e-5),
)

n_opts = 3 * 10 ** 6
n_opts = 3 * 10**6

# compute on CPU sycl device

Expand Down
2 changes: 1 addition & 1 deletion examples/pybind11/use_dpctl_syclqueue/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
print("")
print("Computing modular reduction using SYCL on a NumPy array")

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

Y = eg.offloaded_array_mod(
Expand Down
2 changes: 1 addition & 1 deletion examples/python/usm_memory_host_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# populate buffer from host one byte at a type
for i in range(len(ms)):
ir = i % 256
msv[i] = ir ** 2 % 256
msv[i] = ir**2 % 256

mh = dpmem.MemoryUSMHost(64)
mhv = memoryview(mh)
Expand Down