Python API: Catching Warnings

Questions on using the GAMS APIs (Python, .NET, etc.)
Post Reply
Jan
User
User
Posts: 10
Joined: 7 years ago

Python API: Catching Warnings

Post by Jan »

Hello,

I wonder wether it is possible to catch warning coming from the GAMS API in Python. They are meaningful and I see that they should be respected. But sometimes we are aware of the reasons and want to disregard them for the moment, in particular in running loops over several model runs. One example is the warning about version inconsistencies between the installed gams version and the one installed via pip.

The problem seems to be that these warnings are not implement as Warning from the python module but as print statements and therefore cannot be catched. Is there any solution to that (yes I know, work with consistent version...)?

Many thanks and best
Jan
Post Reply