Giter Club home page Giter Club logo

gdx2py's Introduction

GDX2py

Documentation Status

Read and write GAMS Data eXchange (GDX) files using Python.

Requirements

  • GAMS: version 24.1 or higher
  • Python: 3.6 or higher

Installing GAMS

Get GAMS from https://www.gams.com/download/ and install it to your system. No license is needed for the use of GDX libraries.

Installation

Install with

pip install gdx2py

Usage

>>> from gdx2py import GdxFile, GAMSSet, GAMSScalar, GAMSParameter
>>> with GdxFile('/path/to/gdx/file.gdx', mode='w') as gdx:
>>>     gdx['set1'] = ['a', 'b', 'c']  # Write a simple set
>>>     set1 = gdx['set1']  # Read a symbol
>>>     # Write a 2-dimensional set
>>>     gdx['set2'] = [('a', 'foo'), ('b', 'bar'), ('c', 'baz')]
>>>     # Write a scalar with explanatory text
>>>     gdx['scalar'] = GAMSScalar(3.14, expl_text="Value of pi")  
>>>     # Write a parameter with domain                                     
>>>     gdx['par1'] = GAMSParameter({'a': 1, 'b': 2,  
                                     'c': 3, 'd': 4 }, 
                                    domain=['set1'])  

Comparison to similar packages

Compared to other packages like PyGDX, gdx-pandas, gdxtools and gdxpy, GDX2py relies only on the Python standard library and the low-level GDX API gdxcc package which is available on PyPI.


EU emblem This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 774629.

gdx2py's People

Contributors

erkkar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.