gdxpds

gdx-pandas is a python package to translate between gdx (GAMS data) and pandas


Keywords
gams, gdx, gdx-files, pandas, pandas-dataframes, python, read-write
License
BSD-3-Clause
Install
pip install gdxpds==1.4.0

Documentation

gdx-pandas

PyPI Documentation

gdx-pandas is a python package to translate between gdx (GAMS data) and pandas.

Install | Documentation | Uninstall

Install

Preliminaries

  • 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 the GAMS_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 cause import 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., the gdxcc-8-py3.9.egg file, which on Anaconda is your environment's lib/site-packages directory.

Get the Latest Package

pip install gdxpds

or

pip install git+https://github.com/NREL/gdx-pandas.git@v1.2.0

or

pip install git+https://github.com/NREL/gdx-pandas.git@master

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.

Uninstall

pip uninstall gdxpds