Closed raphaelahrens closed 2 years ago
I'd say this should still raise an error, just with a more actionable message.
I am not sure if the check is really sufficient, maybe it can be done in the call to max()
directly.
For example `max([-1]+orders.values())
I'd say this should still raise an error, just with a more actionable message.
Should an empty model also raise such an error like the following?
tm = TM("my test tm")
tm.ignoreUnused = True
if __name__ == "__main__":
tm.process()
Because this model is not raising any errors.
tm = TM("my test tm")
if __name__ == "__main__":
tm.process()
Thanks!
If a model has only elements which will not be displayed because ignoreUnused is set to True the function _sort_elements() fails.
This is caused by a call to max(orders.values())
which then is
max([])` which is not a computable value.The error is caused by a module like this or an empty model.