spinetoolbox.project_items.exporter.widgets.gdx_export_settings

Export item’s settings window for .gdx export.

author:
  1. Soininen (VTT)
date:

9.9.2019

Module Contents

Classes

State Gdx Export Settings window state
GdxExportSettings A setting window for exporting .gdx files.
class spinetoolbox.project_items.exporter.widgets.gdx_export_settings.State[source]

Bases: enum.Enum

Gdx Export Settings window state

Create and return a new object. See help(type) for accurate signature.

OK[source]

Settings are ok.

BAD_INDEXING[source]

Not all indexed parameters are set up correctly.

class spinetoolbox.project_items.exporter.widgets.gdx_export_settings.GdxExportSettings(set_settings, indexing_settings, merging_settings, none_fallback, none_export, scenario, database_url, parent)[source]

Bases: PySide2.QtWidgets.QWidget

A setting window for exporting .gdx files.

Parameters:
  • set_settings (gdx.SetSettings) – export settings for GAMS sets
  • indexing_settings (dict) – indexing domain information for indexed parameter values
  • merging_settings (dict) – parameter merging settings
  • none_fallback (NoneFallback) – fallback for None parameter values
  • none_export (NoneExport) – how to handle None values while exporting
  • scenario (str, optional) – scenario name
  • database_url (str) – database URL
  • parent (QWidget) – a parent widget
reset_requested[source]

Emitted when Reset Defaults button has been clicked.

settings_accepted[source]

Emitted when the OK button has been clicked.

settings_rejected[source]

Emitted when the Cancel button has been clicked.

set_settings[source]

the settings object

indexing_settings[source]

indexing settings dict

merging_settings[source]

dictionary of merging settings

none_fallback[source]
none_export[source]
reset_settings(self, set_settings, indexing_settings, merging_settings)[source]

Resets all settings.

_check_state(self)[source]

Checks if there are parameters in need for indexing.

_set_none_fallback(self, option)[source]

Sets the None fallback option.

Parameters:option (str) – option as a label in the combo box
_init_none_fallback_combo_box(self, fallback)[source]

Sets the current text in None fallback combo box.

Parameters:fallback (NoneFallback) – option
_set_none_export(self, option)[source]

Sets the None export option.

Parameters:option (str) – option as a label in the combo box
_init_none_export_combo_box(self, export)[source]

Sets the current text in None export combo box

Parameters:export (NoneExport) – option
_populate_global_parameters_combo_box(self, settings)[source]

(Re)populates the global parameters combo box.

_set_records_ordering_controls_enabled(self, enabled)[source]

Sets or unsets the enabled state of buttons that control the record key order.

Parameters:enabled – True if the buttons should be enabled, False otherwise
handle_settings_state_changed(self, state)[source]
_accept(self)[source]

Emits the settings_accepted signal.

_move_sets_up(self, checked=False)[source]

Moves selected domains and sets up one position.

_move_sets_down(self, checked=False)[source]

Moves selected domains and sets down one position.

_move_records_up(self, checked=False)[source]

Moves selected records up and position.

_move_records_down(self, checked=False)[source]

Moves selected records down on position.

_reject(self)[source]

Closes the window.

closeEvent(self, event)[source]
_reset_settings(self, button)[source]

Requests for fresh settings to be read from the database.

_update_global_parameters_domain(self, text)[source]

Updates the global parameters domain name.

_populate_set_contents(self, selected, _)[source]

Populates the record list by the selected domain’s or set’s records.

_sort_records_alphabetically(self, _)[source]

Sorts the lists of set records alphabetically.

_show_indexed_parameter_settings(self, _)[source]

Shows the indexed parameter settings window.

_show_parameter_merging_settings(self, _)[source]

Shows the parameter merging settings window.

_gather_parameter_indexing_settings(self)[source]

Gathers settings from the indexed parameters settings window.

_parameter_merging_approved(self)[source]

Collects merging settings from the parameter merging window.

_dispose_parameter_indexing_settings_window(self)[source]

Removes references to the indexed parameter settings window.

_dispose_parameter_merging_window(self)[source]

Removes references to the parameter merging settings window.

_domains_sets_exportable_state_changed(self, top_left, bottom_right, _)[source]