diff --git a/pytential/symbolic/mappers.py b/pytential/symbolic/mappers.py index d77464923cac33910ebeb46a3b336267a017f1d2..cca6b91983eeefa4c7b3e0113db671893917961f 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*(