From 106816f78e0a7f572c6f796999a6ab0133c4c858 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 23 Nov 2022 02:42:41 -0600 Subject: [PATCH] use a better error message --- pytential/symbolic/pde/system_utils.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pytential/symbolic/pde/system_utils.py b/pytential/symbolic/pde/system_utils.py index e2a72e70a..2a8cda438 100644 --- a/pytential/symbolic/pde/system_utils.py +++ b/pytential/symbolic/pde/system_utils.py @@ -422,8 +422,9 @@ def _get_base_kernel_matrix(base_kernel: ExpressionKernel, order = pde.order if order > pde.order: - raise RuntimeError(f"order ({order}) cannot be greater than the order" - f"of the PDE ({pde.order}) yet.") + raise NotImplementedError("Computing derivative relation when " + "the base kernel's derivatives are linearly dependent has not" + "been implemented yet.") mis = sorted(gnitstam(order, dim), key=sum) # (-1, -1, -1) represent a constant @@ -476,7 +477,12 @@ def _get_base_kernel_matrix(base_kernel: ExpressionKernel, if failed: if retries == 0: - raise RuntimeError("Failed to find a base kernel") + # The derivatives of the base kernel are not linearly + # independent. + # TODO: Extract a linearly independent set and return them + raise NotImplementedError("Computing derivative relation when " + "the base kernel's derivatives are linearly dependent has not " + "been implemented yet.") return _get_base_kernel_matrix( base_kernel=base_kernel, hashable_kernel_arguments=hashable_kernel_arguments,