calliope-project / calliope

A multi-scale energy systems modelling framework
https://www.callio.pe
Apache License 2.0
299 stars 94 forks source link

Better error messages/logging for custom math would help #420

Closed jnnr closed 1 year ago

jnnr commented 1 year ago

Problem description

There are several situations in which error messages could be more telling to help when writing custom math:

Concerning the logging, solving this issue will help: #428

Calliope version

v0.7dev

jnnr commented 1 year ago
**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?