From 4da433bf1d32e6ef18bc06433ae8e2b215cbd191 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 14 Sep 2017 14:26:30 -0500 Subject: [PATCH] Be strict about qbx_forced_limit specifications, acting upon prior deprecation --- pytential/symbolic/mappers.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pytential/symbolic/mappers.py b/pytential/symbolic/mappers.py index d7746492..cca6b919 100644 --- a/pytential/symbolic/mappers.py +++ b/pytential/symbolic/mappers.py @@ -404,12 +404,12 @@ class QBXPreprocessor(IdentityMapper): if not is_self: # non-self evaluation - if expr.qbx_forced_limit == 'avg': - from warnings import warn - warn("qbx_forced_limit == 'avg' is deprecated " - "for non-self evaluation, defaulting to 'None'", - DeprecationWarning) - expr = expr.copy(qbx_forced_limit=None) + if expr.qbx_forced_limit in ['avg', 1, -1]: + raise ValueError("May not specify +/-1 or \"avg\" for " + "qbx_forced_limit for non-self evaluation. " + "Specify 'None' for automatic choice or +/-2 " + "to force a QBX side in the near-evaluation " + "regime.") return expr @@ -419,9 +419,9 @@ class QBXPreprocessor(IdentityMapper): if (isinstance(expr.qbx_forced_limit, int) and abs(expr.qbx_forced_limit) == 2): - warn("qbx_forced_limit == +/-2 is deprecated " - "for self evaluation--must require evaluation side", - DeprecationWarning) + raise ValueError("May not specify qbx_forced_limit == +/-2 " + "for self-evaluation. " + "Specify +/-1 or \"avg\" instead.") if expr.qbx_forced_limit == "avg": return 0.5*( -- GitLab