Hi, just a small bug I encountered: Trying to solve a model whose name contains a space leads to a compilation error, but there is no clear indication that the name is invalid. Also, it should not be possible to assign an invalid name in the first place.
A small example:
from gamspy import Container, Model, Sum, Sense
c = Container()
a = c.addSet("a", records=["a"])
var = c.addVariable("v", domain=a)
eq = c.addEquation("eq", domain=a)
eq[a] = var[a] >= 1
m = Model(container=c,
name="with space",
problem="LP",
equations=c.getEquations(),
sense=Sense.MIN,
objective=Sum(a, var[a]))
m.solve()
This leads to the following error:
GamspyException:
================================================================================
Error Summary
================================================================================
58 solve with space using LP MIN autogenerated_8ef7b1ba_475c_4475_b4c7_a1462bf49f70_variable;
**** $812
**** LINE 4 INPUT [C:\Users\<user name redacted>\AppData\Local\Temp\tmp48vx2ty7\_job_35566420-2f8b-4031-ab1b-a3f87a5830fb.gms](file:///C:/Users/<user name redacted>/AppData/Local/Temp/tmp48vx2ty7/_job_35566420-2f8b-4031-ab1b-a3f87a5830fb.gms)
**** 812 Solve keys expected - USING MAX/MIN SCENARIO
Meaning of return code 2: There was a compilation error
Hi, just a small bug I encountered: Trying to solve a model whose name contains a space leads to a compilation error, but there is no clear indication that the name is invalid. Also, it should not be possible to assign an invalid name in the first place.
A small example:
This leads to the following error: