Skip to content

Add high-level GDX file API for reading and writing GDX files#32

Open
MartinBonde wants to merge 1 commit into
GAMS-dev:masterfrom
MartinBonde:master
Open

Add high-level GDX file API for reading and writing GDX files#32
MartinBonde wants to merge 1 commit into
GAMS-dev:masterfrom
MartinBonde:master

Conversation

@MartinBonde
Copy link
Copy Markdown

Implements direct GDX file access using the native C library, addressing issue #4. Adds GDXFile container with DataFrame-based access to sets, parameters, variables, and equations. Includes read_gdx/write_gdx functions, dictionary-like symbol access, and proper error handling in low-level bindings.

Implements direct GDX file access using the native C library, addressing issue GAMS-dev#4. Adds GDXFile container with DataFrame-based access to sets, parameters, variables, and equations. Includes read_gdx/write_gdx functions, dictionary-like symbol access, and proper error handling in low-level bindings.
@renkekuhlmann
Copy link
Copy Markdown
Member

First of all: Thank you very much for your work. This looks very interesting and addresses a missing piece. Before looking too deep into the code and reviewing, we discussed this internally (which is why it took so long for me to answer - sorry for this). We came to the conclusion that we cannot merge this as is, mainly because the implementation differs from our GAMS Transfer Python / GAMS Transfer Matlab interfaces and we fear that users would expect this product to look and feel the same when it would be part of our repo. We would like to suggest the following: Either you could create your own Julia package or we could add a contrib namespace where this could be released under. We think that this would avoid having users with wrong expectations.

@MartinBonde
Copy link
Copy Markdown
Author

No problem. Consistency with the other APIs seems like a good idea, and not something I gave much consideration.
I will try to keep my fork updated for now, for my own use and in case anyone else needs it, until you create a better solution. It can be used by adding the github source in the Project.toml:

[sources]
GAMS = {url = "https://github.com/MartinBonde/gams.jl"}

For what it is worth, calling the python gams transfer api from Julia works fine.
In fact, I started with that (https://github.com/MartinBonde/GamsGDX.jl), but then realized that solving the actual issue using the C library is quite easy nowadays (with AI assistance), and writing unit tests is straight forward.

@renkekuhlmann
Copy link
Copy Markdown
Member

Okay. That's great! Thanks for your understanding.

jd-foster added a commit to jd-foster/GDXInterface.jl that referenced this pull request Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants