Skip to content

Commit 7053209

Browse files
committed
misc: Change name from PETScSolve to petscsolve
1 parent b6a4436 commit 7053209

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

devito/petsc/iet/passes.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ def lower_petsc(iet, **kwargs):
5353
return finalize(iet), core_metadata()
5454

5555
unique_grids = {i.expr.rhs.grid for (i,) in inject_solve_mapper.values()}
56-
# Assumption is that all solves are on the same grid
56+
# Assumption is that all solves are on the same `Grid`
5757
if len(unique_grids) > 1:
58-
raise ValueError("All `petscsolve` calls must use the same grid, but multiple grids were found.")
58+
raise ValueError(
59+
"All `petscsolve` calls must use the same `Grid`, "
60+
"but multiple `Grid`s were found."
61+
)
5962
grid = unique_grids.pop()
6063
devito_mpi = kwargs['options'].get('mpi', False)
6164
comm = grid.distributor._obj_comm if devito_mpi else 'PETSC_COMM_WORLD'
@@ -77,7 +80,7 @@ def lower_petsc(iet, **kwargs):
7780
if duplicates:
7881
dup_list = ", ".join(repr(p) for p in sorted(duplicates))
7982
raise ValueError(
80-
f"The following `options_prefix` values are duplicated "
83+
"The following `options_prefix` values are duplicated "
8184
f"among your `petscsolve` calls. Ensure each one is unique: {dup_list}"
8285
)
8386

devito/petsc/types/metadata.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def space_dimensions(self):
212212
if len(space_dims) > 1:
213213
# TODO: This may not actually have to be the case, but enforcing it for now
214214
raise ValueError(
215-
"All targets within a `petscsolve` call have to have the same space dimensions."
215+
"All targets within a `petscsolve` call must have the"
216+
" same space dimensions."
216217
)
217218
return space_dims.pop()
218219

@@ -222,7 +223,8 @@ def grid(self):
222223
grids = [t.grid for t in self.targets]
223224
if len(set(grids)) > 1:
224225
raise ValueError(
225-
"Multiple grids detected in `petscsolve`; all targets must share one grid."
226+
"Multiple `Grid`s detected in `petscsolve`;"
227+
" all targets must share one `Grid`."
226228
)
227229
return grids.pop()
228230

0 commit comments

Comments
 (0)