spinetoolbox.project_items.exporter.widgets.parameter_index_settings
¶
Parameter indexing settings window for .gdx export.
author: |
|
---|---|
date: | 26.11.2019 |
Module Contents¶
-
class
spinetoolbox.project_items.exporter.widgets.parameter_index_settings.
IndexSettingsState
[source]¶ Bases:
enum.Enum
An enumeration indicating the state of the settings window.
-
class
spinetoolbox.project_items.exporter.widgets.parameter_index_settings.
ParameterIndexSettings
(parameter_name, indexing_setting, available_existing_domains, new_domains, parent)[source]¶ Bases:
PySide2.QtWidgets.QWidget
A widget showing setting for a parameter with indexed values.
Parameters: - parameter_name (str) – parameter’s name
- indexing_setting (IndexingSetting) – indexing settings for the parameter
- available_existing_domains (dict) – a dict from existing domain name to a list of its record keys
- new_domains (dict) – a dict from new domain name to a list of its record keys
- parent (QWidget) – a parent widget
-
indexing_domain
(self)[source]¶ Provides information needed to expand the parameter’s indexed values.
Returns: a tuple of IndexingDomain and a Set if a new domain is needed for indexing, otherwise None Return type: tuple
-
_check_warnings
(self, mapped_values_balance)[source]¶ Checks if there are non-fatal issues with parameter indexing.
-
_update_indexing_domains_name
(self, domain_name=None)[source]¶ Updates the model’s header and the label showing the indexing domains.
Parameters: domain_name (str) – indexing domain’s name or None to read it from the other widgets.
-
_set_enabled_use_existing_domain_widgets
(self, enabled)[source]¶ Enables and disables controls used to set up indexing based on an existing domain.
-
_set_enabled_create_domain_widgets
(self, enabled)[source]¶ Enables and disables controls used to set up indexing based on a new domain.
-
_update_index_list_selection
(self, expression, clear_selection_if_expression_empty=True)[source]¶ Updates selection according to changed selection expression.
-
_update_model_to_selection
(self, selected, deselected)[source]¶ Updates the model after table selection has changed.
-
_extract_index_from_parameter
(self, _=True)[source]¶ Assigns indexes from the parameter to the model.
-
class
spinetoolbox.project_items.exporter.widgets.parameter_index_settings.
_IndexingTableModel
(parameter)[source]¶ Bases:
PySide2.QtCore.QAbstractTableModel
A table model for parameter value indexing.
First column contains the proposed new index keys. The rest of the columns contain the parameter values for each set of existing index keys. Only selected new index keys are used for indexing. Unselected rows are left empty.
Parameters: parameter (Parameter) – a parameter to model -
data
(self, index, role=Qt.DisplayRole)[source]¶ Returns data associated with given model index and role.
-
mapped_values_balance
(self)[source]¶ Returns the balance between available indexes and parameter values.
Zero means that there is as many indexes available as there are values, i.e. the parameter is ‘perfectly’ indexed. A positive value means there are more indexes than values while a negative value means there are not enough indexes for all values.
Returns: mapped values’ balance Return type: int
-
reorder_indexes
(self, first, last, target)[source]¶ Moves indexes around.
Parameters: - first (int) – first index to move
- last (int) – last index to move (inclusive)
- target (int) – where to move the first index
-