Skip to content
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

assert() -> assert #519

Merged
merged 1 commit into from
Aug 3, 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
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