Open
Description
Summary
When returning Expression.Skip
and Constriant.Skip
, users should be able to attach an exception, or at least exception text to explain why that node is being skipped.
Rationale
This feature request relates to discussions had here and here about how to make clear to the user why an expression for a physical property is being skipped, especially when they might not be the one who wrote a property package or a property model.
Description
The simplest solution would just be to add allow the user to add a string on the frontend to add to the KeyError
:
class therm_cond_phase(object):
"""No method for thermal conductivity"""
@staticmethod
def build_parameters(pobj):
"""No parameters needed"""
pass
@staticmethod
def return_expression(b, p):
"""Raise error when therm_cond_phase is called for in phase p"""
_log.debug(f"Skipping construction of thermal conductivty for phase {p}")
return Expression.Skip(raises=f"Property package does not support thermal conductivity in phase {p}")
A better solution would be to even allow exceptions other than a KeyError:
return Expression.Skip(raises=PropertyError(f"Property package does not support thermal conductivity in phase {p}"))
I have no idea what implementing these on the backend might entail, however.