pnnl / tesp

Other
39 stars 36 forks source link

Error messages generated in model_GLM.py can be misleading #144

Open trevorhardy opened 6 months ago

trevorhardy commented 6 months ago

When adding a new object using add_object(), if set_instance() fails the warning message returned states that the object being added "must be a new object". Through the experience of the user we have found that set_instance() can also fail if the params parameter is malformed though the error message provided will still be the same, causing the user to look for a problem in the wrong place.

We need to do input validation before calling the set_instance() method or as part of the except clause so that the error message provided is meaningful and accurate.

This validation needs to be added to all parts of model_GLM.py to catch a wider variety of causes of failure.