Skip to content

Commit

Permalink
Improved error message for bc_ops argument
Browse files Browse the repository at this point in the history
  • Loading branch information
david-zwicker committed Mar 2, 2024
1 parent b6f3355 commit 21a1f07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pde/pdes/pde.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,13 @@ def __init__(
# setup boundary conditions
if bc_ops is None:
bcs = {"*:*": bc}
else:
elif isinstance(bcs, dict):
bcs = dict(bc_ops)
if "*:*" in bcs and bc != "auto_periodic_neumann":
self._logger.warning("Found default BCs in `bcs` and `bc_ops`")
bcs["*:*"] = bc # append default boundary conditions
else:
raise TypeError('`bc_ops` must be a dictionary')

self.bcs: dict[str, Any] = {}
for key_str, value in bcs.items():
Expand Down

0 comments on commit 21a1f07

Please sign in to comment.