diff --git a/.github/workflows/pytest-gpu.yml b/.github/workflows/pytest-gpu.yml index facde11f75a..71f00331068 100644 --- a/.github/workflows/pytest-gpu.yml +++ b/.github/workflows/pytest-gpu.yml @@ -59,13 +59,6 @@ jobs: test_drive_cmd: "nvidia-smi" flags: '--gpus all --rm --name testrun-nvc' - # - name: pytest-gpu-omp-nvidia - # test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openmp.py" - # base: "devitocodes/bases:nvidia-nvc" - # tags: ["self-hosted", "nvidiagpu"] - # test_drive_cmd: "nvidia-smi" - # flags: '--gpus all --rm --name testrun-nvc-omp-nvidia --env DEVITO_LANGUAGE=openmp' - - name: pytest-gpu-omp-amd test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openmp.py" tags: ["self-hosted", "amdgpu"] diff --git a/devito/finite_differences/derivative.py b/devito/finite_differences/derivative.py index 54aa4594791..e8db6e882e7 100644 --- a/devito/finite_differences/derivative.py +++ b/devito/finite_differences/derivative.py @@ -89,7 +89,7 @@ class Derivative(sympy.Derivative, Differentiable): __rkwargs__ = ('side', 'deriv_order', 'fd_order', 'transpose', '_ppsubs', 'x0') def __new__(cls, expr, *dims, **kwargs): - if type(expr) == sympy.Derivative: + if type(expr) is sympy.Derivative: raise ValueError("Cannot nest sympy.Derivative with devito.Derivative") if not isinstance(expr, Differentiable): raise ValueError("`expr` must be a Differentiable object") diff --git a/devito/ir/iet/nodes.py b/devito/ir/iet/nodes.py index fc9e907d759..989f557a0ba 100644 --- a/devito/ir/iet/nodes.py +++ b/devito/ir/iet/nodes.py @@ -185,7 +185,7 @@ class List(Node): def __init__(self, header=None, body=None, footer=None): body = as_tuple(body) - if len(body) == 1 and all(type(i) == List for i in [self, body[0]]): + if len(body) == 1 and all(type(i) is List for i in [self, body[0]]): # De-nest Lists # # Note: to avoid disgusting metaclass voodoo (due to diff --git a/devito/ir/support/space.py b/devito/ir/support/space.py index 48833699ad3..b85b017b4aa 100644 --- a/devito/ir/support/space.py +++ b/devito/ir/support/space.py @@ -36,7 +36,7 @@ def __init__(self, dim, stamp=S0): self.stamp = stamp def __eq__(self, o): - return (type(self) == type(o) and + return (type(self) is type(o) and self.dim is o.dim and self.stamp == o.stamp) diff --git a/devito/passes/clusters/aliases.py b/devito/passes/clusters/aliases.py index 106a0c8c79b..1e8626da18f 100644 --- a/devito/passes/clusters/aliases.py +++ b/devito/passes/clusters/aliases.py @@ -932,7 +932,7 @@ def pick_best(variants, schedule_strategy, eval_variants_delta): Return the variant with the best trade-off between operation count reduction and working set increase. Heuristics may be applied. """ - if type(schedule_strategy) == int: + if type(schedule_strategy) is int: try: return variants[schedule_strategy] except IndexError: diff --git a/devito/symbolics/inspection.py b/devito/symbolics/inspection.py index aae2e4e4144..cc05188cfb7 100644 --- a/devito/symbolics/inspection.py +++ b/devito/symbolics/inspection.py @@ -42,7 +42,7 @@ def compare_ops(e1, e2): >>> compare_ops(u[x] + u[x+1], u[x] + u[y+10]) True """ - if type(e1) == type(e2) and len(e1.args) == len(e2.args): + if type(e1) is type(e2) and len(e1.args) == len(e2.args): if e1.is_Atom: return True if e1 == e2 else False elif e1.is_Indexed and e2.is_Indexed: diff --git a/devito/types/dimension.py b/devito/types/dimension.py index 19b00266284..6626f095176 100644 --- a/devito/types/dimension.py +++ b/devito/types/dimension.py @@ -1582,7 +1582,7 @@ def _separate_dims(cls, d0, d1, ofs_items): def dimensions(names): - assert type(names) == str + assert type(names) is str return tuple(Dimension(i) for i in names.split()) diff --git a/tests/test_builtins.py b/tests/test_builtins.py index 0548039a3db..0c70d63e868 100644 --- a/tests/test_builtins.py +++ b/tests/test_builtins.py @@ -490,7 +490,7 @@ def test_issue_1863(self): assert v0 == v1 assert v0 == v2 assert v0 == v3 - assert type(v0) == np.int16 - assert type(v1) == np.int32 - assert type(v2) == np.float32 - assert type(v3) == np.float64 + assert type(v0) is np.int16 + assert type(v1) is np.int32 + assert type(v2) is np.float32 + assert type(v3) is np.float64 diff --git a/tests/test_derivatives.py b/tests/test_derivatives.py index 3ad27f70401..a303e929aed 100644 --- a/tests/test_derivatives.py +++ b/tests/test_derivatives.py @@ -197,7 +197,7 @@ def test_derivatives_space(self, derivative, dim, order): s_expr = u.diff(dim).as_finite_difference(indices).evalf(_PRECISION) assert(simplify(expr - s_expr) == 0) # Symbolic equality - assert type(expr) == EvalDerivative + assert type(expr) is EvalDerivative expr1 = s_expr.func(*expr.args) assert(expr1 == s_expr) # Exact equality @@ -217,7 +217,7 @@ def test_second_derivatives_space(self, derivative, dim, order): indices = [(dim + i * dim.spacing) for i in range(-width, width + 1)] s_expr = u.diff(dim, dim).as_finite_difference(indices).evalf(_PRECISION) assert(simplify(expr - s_expr) == 0) # Symbolic equality - assert type(expr) == EvalDerivative + assert type(expr) is EvalDerivative expr1 = s_expr.func(*expr.args) assert(expr1 == s_expr) # Exact equality diff --git a/tests/test_dimension.py b/tests/test_dimension.py index 702f9317409..408dd3ffb5b 100644 --- a/tests/test_dimension.py +++ b/tests/test_dimension.py @@ -443,8 +443,8 @@ def test_subdimmiddle_parallel(self, opt): thickness_left=thickness, thickness_right=thickness) # a 5 point stencil that can be computed in parallel - centre = Eq(u[t+1, xi, yi], u[t, xi, yi] + u[t, xi-1, yi] - + u[t, xi+1, yi] + u[t, xi, yi-1] + u[t, xi, yi+1]) + centre = Eq(u[t+1, xi, yi], u[t, xi, yi] + u[t, xi-1, yi] + + u[t, xi+1, yi] + u[t, xi, yi-1] + u[t, xi, yi+1]) u.data[0, 10, 10] = 1.0