Is your feature request related to a problem? Please describe.
PINA modules heavily rely on the check_consistency function. This function is used to throw errors when passing an invalid instance or class object. The error message, however, is very short and, most of the time, unclear:
>>> from pina.solver import PINN
>>> PINN(2, 3)
ValueError: int must be <class 'pina.problem.abstract_problem.AbstractProblem'>.
Describe the solution you'd like
It would be nice to have a richer and more informative error message, something like:
subclass=true but instance passed
ValueError: You passed <wrong_instance> instance, but a <true_class> class was expected. Please pass a <true_object> class or a derived one.
subclass=true but wrong classe
ValueError: You passed <wrong_class> class, but a <true_class> class was expected. Please pass a <true_object> class or a derived one.
subclass=False but class passed
ValueError: You passed <wrong_class> class, but a <true_instance> instance was expected. Please pass a <true_instance> instance.
subclass=False but wrong instance
ValueError: You passed <wrong_instance> instance, but a <true_instance> instance was expected. Please pass a <true_instance> instance.
Describe alternatives you've considered
Maybe we should wrap this into a more structured class for handling errors in PINA.
Is your feature request related to a problem? Please describe.
PINA modules heavily rely on the
check_consistencyfunction. This function is used to throw errors when passing an invalid instance or class object. The error message, however, is very short and, most of the time, unclear:Describe the solution you'd like
It would be nice to have a richer and more informative error message, something like:
subclass=truebut instance passedsubclass=truebut wrong classesubclass=Falsebut class passedsubclass=Falsebut wrong instanceDescribe alternatives you've considered
Maybe we should wrap this into a more structured class for handling errors in PINA.