Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Jan 4, 2025
1 parent 5894b49 commit 897cd3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
15 changes: 6 additions & 9 deletions firedrake/formmanipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,8 @@ def cofunction(self, o):
# Not on a mixed space, just return ourselves.
return o

try:
indices, = set(self.blocks.values())
except ValueError:
raise ValueError("Cofunction found on an off-diagonal block")

# We only need the test space for Cofunction 
indices = self.blocks[0]

Check failure on line 148 in firedrake/formmanipulation.py

View workflow job for this annotation

GitHub Actions / Run linter

E999

firedrake/formmanipulation.py:148:1: E999 SyntaxError: invalid character in identifier
if len(indices) == 1:
i = indices[0]
W = V[i]
Expand Down Expand Up @@ -196,15 +193,15 @@ def split_form(form, diagonal=False):
args = form.arguments()
shape = tuple(len(a.function_space()) for a in args)
forms = []
arity = len(shape)
rank = len(shape)
if diagonal:
assert arity == 2
arity = 1
assert rank == 2
rank = 1
for idx in numpy.ndindex(shape):
if diagonal:
i, j = idx
if i != j:
continue
f = splitter.split(form, idx)
forms.append(SplitForm(indices=idx[:arity], form=f))
forms.append(SplitForm(indices=idx[:rank], form=f))
return tuple(forms)
1 change: 0 additions & 1 deletion firedrake/slate/slac/tsfc_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def compile_terminal_form(tensor, prefix, *, tsfc_parameters=None):
assert tensor.terminal, (
"Only terminal tensors have forms associated with them!"
)

# Sets a default name for the subkernel prefix.
mapper = RemoveRestrictions()
integrals = map(partial(map_integrand_dags, mapper),
Expand Down

0 comments on commit 897cd3c

Please sign in to comment.