Search found 10 matches

by Jan
2 months ago
Forum: API
Topic: Python API: Catching Warnings
Replies: 0
Views: 1722

Python API: Catching Warnings

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 exa...
by Jan
2 years ago
Forum: API
Topic: ModuleNotFoundError: No module named '_gams2numpy'
Replies: 9
Views: 44273

Re: ModuleNotFoundError: No module named '_gams2numpy'

Dear Clemens,

I tested it under python 3.8 and both import (gamstransfer and gams module) work fine.

Many thanks for your help!
Jan
by Jan
2 years ago
Forum: API
Topic: ModuleNotFoundError: No module named '_gams2numpy'
Replies: 9
Views: 44273

ModuleNotFoundError: No module named '_gams2numpy'

Dear all, I try to install the GAMS python API under GAMS version 38.2.1 on Windows10 system. Using the setup.py command seems to work. However, trying to import gamstransfer I receive an error message: --------------------------------------------------------------------------- ModuleNotFoundError T...
by Jan
3 years ago
Forum: API
Topic: Python API: ModelInstance QCP - Modifier on quadratic objective term
Replies: 2
Views: 4647

Re: Python API: ModelInstance QCP - Modifier on quadratic objective term

Dear Michael,

thanks for the quick reply. I did not see in the documentation. I will give a try to the NLP solution with the solvers you mentioned.

Best
Jan
by Jan
3 years ago
Forum: API
Topic: Python API: ModelInstance QCP - Modifier on quadratic objective term
Replies: 2
Views: 4647

Python API: ModelInstance QCP - Modifier on quadratic objective term

test_qp_modelinstance.txt Hello, I want to instantiate a QCP model with modifiers in the objective function. As an example, the attached file contains the QCP and LP version of a simple electricity dispatch model with objective functions: obj_qp.. WELFARE =E= dem_a/dem_b*DEM - 1/(2*dem_b)*(DEM*DEM)...
by Jan
3 years ago
Forum: API
Topic: Python API: Option Export
Replies: 1
Views: 4561

Python API: Option Export

Hi I am trying to export options to a file with GAMS API under PYthon 3.8 using the follwing code: import gams import os ws = gams.GamsWorkspace(os.getcwd()) opt = ws.add_options() opt.defines["test"] = 5 opt.export("./test.gms") This raises an error in options.py: ~\anaconda3\en...
by Jan
6 years ago
Forum: API
Topic: Python API Installation User Folder
Replies: 1
Views: 4007

Python API Installation User Folder

Hi, I am trying to install the Python API on a Linux server. Python is installed server and I do not have writing access to the standard "site-packages" folder. I thus need to install to the user "site-packages" folder. When I use the option for this in calling setup.py, i.e., py...
by Jan
7 years ago
Forum: API
Topic: Modifying Parameter in MCP ModelInstance
Replies: 1
Views: 9765

Modifying Parameter in MCP ModelInstance

Dear all, I try to modify a parameter of a ModelInstance representing and MCP model. A minimal example based on the MCP transport model from the library is given below. Instantiating the model, an error is raised from "gmoLoadDataLegacy" telling me that I have an unmatched column and no un...
by Jan
7 years ago
Forum: API
Topic: Python API, Jupyter, Solver Log
Replies: 2
Views: 7229

Re: Python API, Jupyter, Solver Log

OK. Thanks for the quick reply!

Best Jan
by Jan
7 years ago
Forum: API
Topic: Python API, Jupyter, Solver Log
Replies: 2
Views: 7229

Python API, Jupyter, Solver Log

Dear all, solving a model instance in Jupyter notebook (v 4.2.3) using debug level 2, I like the solver output to show up in the output cell of the notebook. However, it is redirected to the console (see trn_lp.ipynb, see trn_mcp.py). Do you have any hints, how to get the solver log into the noteboo...