Embedded Python code - Import parameter with gams.get
Posted: Thu Aug 23, 2018 7:29 pm
Hi all,
I am stuck with the gams.get method. In particular, I am not able to use the parameters defined in GAMS in the Python section. For instance, I have tried the following:
parameter ParA;
ParA = 5;
$onEmbeddedCode Python:
ParA = int(gams.get("ParA"))
$offEmbeddedCode
I get the following error: "Exception from Python: int() argument must be a string, a bytes-like object or a number, not 'ECSymbol"
If I try to import the parameter as a list ... ParA = list(gams.get("ParA")) ... it seems that the list is empty. I have tried some options like ValueFormat, but without success so far.
Do you maybe have an idea what I am missing here?
Best regards,
Luis
I am stuck with the gams.get method. In particular, I am not able to use the parameters defined in GAMS in the Python section. For instance, I have tried the following:
parameter ParA;
ParA = 5;
$onEmbeddedCode Python:
ParA = int(gams.get("ParA"))
$offEmbeddedCode
I get the following error: "Exception from Python: int() argument must be a string, a bytes-like object or a number, not 'ECSymbol"
If I try to import the parameter as a list ... ParA = list(gams.get("ParA")) ... it seems that the list is empty. I have tried some options like ValueFormat, but without success so far.
Do you maybe have an idea what I am missing here?
Best regards,
Luis