spinetoolbox.spine_io.importers.gdx_connector¶
Contains GDXConnector class and a help function.
| author: |
|
|---|---|
| date: | 1.6.2019 |
Module Contents¶
Classes¶
GdxConnector |
Template class to read data from another QThread. |
Functions¶
select_gdx_file(parent=None) |
Launches QFileDialog with .gdx filter |
-
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(settings)[source]¶ Bases:
spinetoolbox.spine_io.io_api.SourceConnectionTemplate class to read data from another QThread.
Parameters: settings (dict) – a dict from “gams_directory” to GAMS path; if the argument is None or the path is empty or None, a default path is used -
connect_to_source(self, source)[source]¶ Connects to given .gdx file.
Parameters: source (str) – path to .gdx file.
-
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
-