spinetoolbox.spine_io.importers.gdx_connector

Contains GDXConnector class and a help function.

author:
  1. Vennström (VTT)
date:

1.6.2019

Module Contents

spinetoolbox.spine_io.importers.gdx_connector.select_gdx_file(parent=None)[source]

Launches QFileDialog with .gdx filter

class spinetoolbox.spine_io.importers.gdx_connector.GdxConnector[source]

Bases: spinetoolbox.spine_io.io_api.SourceConnection

Template class to read data from another QThread.

DISPLAY_NAME = Gdx[source]

name of data source

OPTIONS[source]

dict with option specification for source

SELECT_SOURCE_UI[source]

Modal widget that returns source object and action (OK, CANCEL).

__exit__(self, exc_type, exc_value, traceback)[source]
__del__(self)[source]
connect_to_source(self, source)[source]

Connects to given .gdx file.

Parameters:source (str) – path to .gdx file.
disconnect(self)[source]

Disconnects from connected source.

get_tables(self)[source]

Returns a list of table names.

GAMS scalars are also regarded as tables.

Returns:Table names in list
Return type:list(str)
get_data_iterator(self, table, options, max_rows=-1)[source]

Creates an iterator for the data source

Parameters:
  • table (string) – table name
  • options (dict) – dict with options
Keyword Arguments:
 

max_rows (int) – ignored

Returns:

data iterator, list of column names, number of columns

Return type:

tuple