Skip to content

Commit 5699d71

Browse files
committed
Add flake8 eradicate
1 parent 26518c3 commit 5699d71

22 files changed

+22
-58
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ per-file-ignores =
1313
__init__.py: F403
1414
# module level import not at top of file
1515
target.py: E402
16+
# config should containe code lines examples in comment
17+
docs/source/conf.py: E800
1618
exclude =
1719
.git,
1820
__pycache__,
1921
_version.py,
22+
versioneer.py,
2023
lowerer.py,
2124
parfor.py

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ repos:
3535
rev: 3.9.2
3636
hooks:
3737
- id: flake8
38+
additional_dependencies: [flake8-eradicate]
3839
- repo: https://github.com/koalaman/shellcheck-precommit
3940
rev: v0.8.0
4041
hooks:

numba_dpex/core/itanium_mangler.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ def mangle_identifier(ident, template_params="", *, abi_tags=(), uid=None):
184184
185185
This treats '.' as '::' in C++.
186186
"""
187-
# if uid is not None:
188-
# Add uid to abi-tags
189-
# abi_tags = (f"v{uid}", *abi_tags)
190187
parts = [_len_encoded(_escape_string(x)) for x in ident.split(".")]
191188
enc_abi_tags = list(map(mangle_abi_tag, abi_tags))
192189
extras = template_params + "".join(enc_abi_tags)

numba_dpex/core/kernel_interface/dispatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def __call__(self, *args):
488488

489489
# TODO: return event that calls wait if no reference to the object if
490490
# it is possible
491-
# event = exec_queue.submit(
491+
# event = exec_queue.submit( # noqa: E800
492492
exec_queue.submit(
493493
sycl_kernel,
494494
packer.unpacked_args,

numba_dpex/core/parfors/parfor_lowerer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def _lower_parfor_as_kernel(self, lowerer, parfor):
414414
flags.error_model = "numpy"
415415

416416
# Can't get here unless
417-
# flags.set('auto_parallel', ParallelOptions(True))
417+
# flags.set('auto_parallel', ParallelOptions(True)) # noqa: E800
418418
index_var_typ = typemap[parfor.loop_nests[0].index_variable.name]
419419

420420
# index variables should have the same type, check rest of indices

numba_dpex/core/parfors/reduction_helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _allocate_partial_reduction_arrays(
4141
# Get the type of the reduction variable.
4242
redvar_typ = lowerer.fndesc.typemap[red_name]
4343

44-
# redarrvar_typ is type(partial_sum)
44+
# redarrvar_typ is type(partial_sum) # noqa: E800 help understanding
4545
redarrvar_typ = self._redtyp_to_redarraytype(redvar_typ, inputArrayType)
4646
reddtype = redarrvar_typ.dtype
4747
redarrdim = redarrvar_typ.ndim
@@ -63,7 +63,7 @@ def _allocate_partial_reduction_arrays(
6363
name="tot_work",
6464
)
6565

66-
# global_size_mod = tot_work%work_group_size
66+
# global_size_mod = tot_work%work_group_size # noqa: E800 help understanding
6767
ir_expr = ir.Expr.binop(
6868
operator.mod, total_work_var, work_group_size_var, loc
6969
)
@@ -232,7 +232,7 @@ def __init__(
232232
loop_body = copy.copy(parfor_node.loop_body)
233233
remove_dels(loop_body)
234234

235-
# parfor_dim = len(parfor_node.loop_nests)
235+
# parfor_dim = len(parfor_node.loop_nests) # noqa: E800 help understanding
236236
loop_indices = [
237237
loop_nest.index_variable.name
238238
for loop_nest in parfor_node.loop_nests

numba_dpex/core/targets/dpjit_target.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ def init(self):
3838
self.is32bit = utils.MACHINE_BITS == 32
3939
self._internal_codegen = JITCPUCodegen("numba.exec")
4040
self.lower_extensions = {}
41+
# TODO: initialize nrt once switched to nrt from drt. Most likely we
42+
# call it somewhere. Double check.
43+
# https://github.com/IntelPython/numba-dpex/issues/1175
4144
# Initialize NRT runtime
42-
# rtsys.initialize(self)
45+
# rtsys.initialize(self) # noqa: E800
4346
self.refresh()
4447

4548
@cached_property

numba_dpex/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def dpjit(*args, **kws):
159159
# FIXME: When trying to use dpex's target context, overloads do not work
160160
# properly. We will turn on dpex target once the issue is fixed.
161161

162-
# kws.update({"_target": "dpex"})
162+
# kws.update({"_target": "dpex"}) # noqa: E800
163163

164164
return decorators.jit(*args, **kws)
165165

numba_dpex/dpnp_iface/arrayobj.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def impl(
234234
shape,
235235
dtype=None,
236236
order="C",
237-
# like=None, # see issue https://github.com/IntelPython/numba-dpex/issues/998
237+
# like=None, # noqa: E800 see issue https://github.com/IntelPython/numba-dpex/issues/998
238238
device=None,
239239
usm_type="device",
240240
sycl_queue=None,
@@ -243,7 +243,7 @@ def impl(
243243
shape,
244244
_dtype,
245245
order,
246-
# like, # see issue https://github.com/IntelPython/numba-dpex/issues/998
246+
# like, # noqa: E800 see issue https://github.com/IntelPython/numba-dpex/issues/998
247247
_device,
248248
_usm_type,
249249
sycl_queue,

numba_dpex/examples/blacksholes_njit.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212

1313
import numba_dpex as dpex
1414

15-
# @numba.vectorize(nopython=True)
16-
# def cndf2(inp):
17-
# out = 0.5 + 0.5 * math.erf((math.sqrt(2.0) / 2.0) * inp)
18-
# return out
19-
2015

2116
@dpex.dpjit
2217
def blackscholes(sptprice, strike, timev, rate, volatility):
@@ -68,7 +63,6 @@ def run(iterations):
6863
t1 = time.time()
6964
put = blackscholes(sptprice, initStrike, rate, volatility, timev)
7065
t = time.time() - t1
71-
# print("checksum: ", sum(put))
7266
print(put)
7367
print("SELFTIMED ", t)
7468

0 commit comments

Comments
 (0)