Better error messages/logging for custom math would help
jnnr opened this issue · comments
Problem description
There are several situations in which error messages could be more telling to help when writing custom math:
- Raise Error: If there are excess dims, pyomo receives dataarrays and gives an unrelated error message. This should be checked by us before creating the constraint and a readable error should be raised. #417
- Raise Error: Equations or expressions containing NaN should raise an error and report detailed information to a log (without drowning the rest of the logging) #417
- Not raise Error: Errors / non-applicable where strings on evaluating parsed strings should not raise errors/warnings but should add to an appropriate logging level that reports all the issues, so a user can see why a particular optimisation problem element did not get initialised. update I think that the appropriate logging level would be the lowest possible, i.e. 'debug'.
Concerning the logging, solving this issue will help: #428
Calliope version
v0.7dev
**Raise Error**: If there are excess dims, pyomo receives dataarrays and gives an unrelated error message. This should be checked by us before creating the constraint and a readable error should be raised.
Tried to reproduce this error and write a test but did not succeed yet. Tried it with a constraint containing a sum that misses some dims in over
, but did not get an error. Do you remember how to get there, @brynpickering?