:mod:`gdx2py` ============= .. py:module:: gdx2py Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 gams/index.rst gdxfile/index.rst Package Contents ---------------- .. py:class:: GdxFile(filename: str, mode: str = 'r', gams_dir: str = None) Bases: :class:`object` Class for working with a gdx file Use subscripting (gdx_object['']) to get/set a GAMS set or parameter symbol. .. attribute:: filename Absolute filename :type: str Constructor for GdxFile :param filename: str :param mode: File open mode: 'r' for reading, 'w' for writing, 'w+' for appending (replaces existing symbol) :param gams_dir: Location of GAMS installation directory :type gams_dir: optional :raises RuntimeError: Unable to load gdx library, invalid mode :raises FileNotFoundError: Input file not found :raises ValueError: Unsupported mode :raises OSError: Unable to read/write file :raises Exception: Other errors .. method:: keys(self) .. method:: close(self) .. method:: symrange(sym_count) :staticmethod: .. py:class:: GAMSSet(keys: Sequence[tuple], domain: Sequence[str] = None, expl_text: str = '', assoc_texts: Sequence[str] = None) Bases: :class:`gdx2py.gams._GAMSNDimSymbol` Class for GAMS Sets .. attribute:: elements Set elements :type: list .. attribute:: expl_text Set explanatory text :type: str .. attribute:: assoc_texts Set element associated texts :type: list Constructor for GAMSSet :param keys: Sequence of tuples of strings for the keys :param domain: Sequence of domain set names, use `None` for the universal set :type domain: optional :param expl_text: Explanatory text :type expl_text: optional :param assoc_texts: Set element associated texts :type assoc_texts: optional :raises ValueError: .. method:: elements(self) :property: .. method:: assoc_texts(self) :property: .. py:class:: GAMSScalar(value: float, expl_text: str = '') Bases: :class:`gdx2py.gams._GAMSSymbol` Class for GAMS Scalars (0-dimensional Parameters) .. attribute:: expl_text Symbol explanatory text :type: str Class constructor :param name: Symbol name :param value: Value :raises ValueError: .. py:class:: GAMSParameter(data: Mapping[tuple, float], domain: Sequence[str] = None, expl_text: str = '') Bases: :class:`gdx2py.gams._GAMSNDimSymbol` Class for GAMS Parameters .. attribute:: domain List of set names that make the domain of the symbol :type: list .. attribute:: expl_text Symbol explanatory text :type: str .. method:: keys Return a view to the symbol's keys .. method:: values Return a view to the symbol's values Constructor for GAMSParameter :param data: Dictionay of keys and values :param domain: List of domain set names, use `None` for the universal set :type domain: optional :param expl_text: Explanatory text :type expl_text: optional :raises ValueError: .. method:: keys(self) .. method:: values(self) .. method:: to_pandas(self)