Search found 46 matches

by Clemens
10 months ago
Forum: Tools
Topic: MySQL, GAMS and Unix
Replies: 3
Views: 450

Re: MySQL, GAMS and Unix

Renger, Using Embedded Code is in my opinion a good idea. You save the extra Python file and you could do it without writing the CSV file. Something like this: parameter p(*,*); $onEmbeddedCode Python: import pandas as pd data = [('a', 'a', 2), ('a','b', 4), ('b', 'a', 1), ('b','b', 3)] df = pd.Data...
by Clemens
1 year ago
Forum: API
Topic: Embedded Python code - Import parameter with gams.get
Replies: 2
Views: 1229

Re: Embedded Python code - Import parameter with gams.get

Luis, First of all, note that the assignment ParA = 5; happens during GAMS execution time and the $onEmbeddedCode/$offEmbeddedCode section is performaned during GAMS compilation time. That means that in the embedded code section, no value will be assigned to ParA . For more information about GAMS ex...
by Clemens
1 year ago
Forum: API
Topic: Fastest interaction between GAMS and Python
Replies: 2
Views: 1402

Re: Fastest interaction between GAMS and Python

Serge, 1) Loading a model form string or from file is very unlikely to make any difference in terms of performance. In any case a GamsJob will result in a file containing the source code when the run() method is called. 2) This depends on your specific situation. If large parts of the GamsDatabase r...
by Clemens
1 year ago
Forum: API
Topic: GAMS API Python
Replies: 7
Views: 2226

Re: GAMS API Python

Then it was perhaps a mismatch in the version of the Python API and the Python interpreter. Both the bitness as well as the version (2.7, 3.6 etc) need to match. Good to hear that you got it working. You have probably seen the tutorial already, but in case you did not, here it is: https://www.gams.c...
by Clemens
1 year ago
Forum: API
Topic: GAMS API Python
Replies: 7
Views: 2226

Re: GAMS API Python

Hi, The error is most likely caused by a bitness mismatch of your GAMS version including the Python API and your version of Python itself. Please double check your Python version if it is really 32 bit by just launching the live interpreter on the command line and looking at the output. Regarding th...
by Clemens
1 year ago
Forum: API
Topic: _gdxcc.so issue
Replies: 3
Views: 1608

Re: _gdxcc.so issue

David, The file _gdxcc.so is required by the Object-oriented Python API. GAMS distributes different version of the file for the different API versions (Python 2.7, 3.6, etc.) and one version which is located directly in the GAMS system directory ( /Applications/GAMS25.0/sysdir/ ). This version of th...
by Clemens
1 year ago
Forum: API
Topic: Is there any tutorial about the connection between python and gams?
Replies: 1
Views: 1266

Re: Is there any tutorial about the connection between python and gams?

Hi, GAMS offers basically two technologies for combining Python and GAMS. The GAMS Object-oriented Python API offers a Python interface for interacting with GAMS. For further information, please have a look at the documentation which also provides a tutorial: https://www.gams.com/latest/docs/API_PY_...
by Clemens
1 year ago
Forum: Announcements
Topic: GAMS Studio
Replies: 3
Views: 3226

Re: GAMS Studio

Chris,

Thank you for sharing this idea with us. The concept of a language server is very nice. However, the first versions of GAMS Studio will most likely not support this feature. We keep this in our backlog and will at some stage decide if and how such a feature can be implemented.

Best,
Clemens
by Clemens
1 year ago
Forum: API
Topic: model2tex
Replies: 4
Views: 1985

Re: model2tex

The overflowing problem is well known to us. Unfortunately so far we do not have a general solution for this. model2tex is written in Python and implements a stack machine that works on the instructions generated by the GAMS compiler. If you put a $debug dmpins at the end of a model you can look at ...
by Clemens
1 year ago
Forum: API
Topic: model2tex
Replies: 4
Views: 1985

Re: model2tex

Hi, This seems to be a bug in model2tex regarding SOS variables. Thank you very much for reporting. For now you could temporarily change your SOS variables to non-SOS variables to see if this lets you generate the LaTeX file. Afterwards you can change them back to SOS variables. The only effect on t...