Skip to content

Commit

Permalink
assert() -> assert (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Aug 3, 2022
1 parent 65d69ae commit af5aba0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ffcx/codegeneration/flop_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
def count_flops(form: ufl.Form, parameters: Optional[dict] = {}):
"""Return a list with the number of flops for each kernel in the Form."""
parameters = ffcx.parameters.get_parameters(parameters)
assert(isinstance(form, ufl.Form))
assert isinstance(form, ufl.Form)
analysis = analyze_ufl_objects([form], parameters)
ir = compute_ir(analysis, {}, "flops", parameters, False)

Expand Down
2 changes: 1 addition & 1 deletion ffcx/ir/integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def compute_integral_ir(cell, integral_type, entitytype, integrands, argument_sh
expressions = [None, ] * num_components
for target in S_targets:
for comp in S.nodes[target]["component"]:
assert(expressions[comp] is None)
assert expressions[comp] is None
expressions[comp] = S.nodes[target]["expression"]
expression = ufl.as_tensor(numpy.reshape(expressions, expression.ufl_shape))

Expand Down
4 changes: 2 additions & 2 deletions test/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ def test_cache_modes(compile_args):
newfile = module.__file__
print(newname, newfile)

assert(newname == tmpname)
assert(newfile != tmpfile)
assert newname == tmpname
assert newfile != tmpfile
4 changes: 2 additions & 2 deletions test/test_flops.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def test_flops():
dofs2 = (k2 + 1.) * (k2 + 2.) / 2.

flops_1 = count_flops(a1)
assert(len(flops_1) == 2)
assert len(flops_1) == 2

flops_2 = count_flops(a2)
assert(len(flops_2) == 2)
assert len(flops_2) == 2

r = sum(flops_2, 0.) / sum(flops_1, 0.)

Expand Down

0 comments on commit af5aba0

Please sign in to comment.