gdx-pandas is a python package to translate between gdx (GAMS data) and pandas.
Install | Documentation | Uninstall
- Python 3.7 or higher (exact compatibility might depend on which GAMS version you are using)
- pandas (In general you will want the SciPy stack. Anaconda comes with it, or see my notes for Windows.)
- Install GAMS
- Put the GAMS directory in your
PATH
and/or assign it to theGAMS_DIR
environment variable - GAMS Python bindings
-
See GAMS//apifiles/readme.txt on Windows and Mac, or /opt/gams//apifiles/readme.txt on Linux
-
Run the following for the correct version of the Python bindings (e.g., from the GAMS/**/apifiles/Python/api_39 folder):
python setup.py install
or
python setup.py build --build-base={temporary-path-where-you-have-write-access} install
with the latter being for the case when you can install packages into Python but don't have GAMS directory write access.
-
If
import gdxcc
fails (which will also causeimport gdxpds
to fail) because there "is no_gdxcc
module", one workaround is to copy all the_*.pyd
(or_*.so
) files from GAMS/**/apifiles/Python/api_XX/ and paste them into your Python environment next to, e.g., thegdxcc-8-py3.9.egg
file, which on Anaconda is your environment's lib/site-packages directory.
-
pip install gdxpds
or
pip install git+https://github.com/NREL/[email protected]
or
pip install git+https://github.com/NREL/gdx-pandas.git@main
Versions are listed at pypi and https://github.com/NREL/gdx-pandas/releases.
After installation, you can test the package using pytest:
pytest --pyargs gdxpds
If the tests fail due to permission IOErrors, apply chmod g+x
and chmod a+x
to the gdx-pandas/gdxpds/test
folder.
pip uninstall gdxpds