spinetoolbox.mvcmodels.pivot_model

Provides PivotModel.

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

1.11.2018

Module Contents

class spinetoolbox.mvcmodels.pivot_model.PivotModel[source]
rows[source]
columns[source]
reset_model(self, data, index_ids=(), rows=(), columns=(), frozen=(), frozen_value=())[source]

Resets the model.

clear_model(self)[source]
update_model(self, data)[source]
add_to_model(self, data)[source]
remove_from_model(self, data)[source]
_check_pivot(self, rows, columns, frozen, frozen_value)[source]

Checks if given pivot is valid.

Returns:error message or None if no error
Return type:str, NoneType
_index_key_getter(self, indexes)[source]

Returns an itemgetter that always returns tuples from list of indexes

_get_unique_index_values(self, indexes)[source]

Returns unique indexes that match the frozen condition.

Parameters:indexes (list) –
Returns
list
set_pivot(self, rows, columns, frozen, frozen_value)[source]

Sets pivot.

set_frozen_value(self, value)[source]

Sets values for the frozen indexes.

get_pivoted_data(self, row_mask, column_mask)[source]

Returns data for indexes in row_mask and column_mask.

Parameters:
  • row_mask (list) –
  • column_mask (list) –
Returns:

list(list)

row_key(self, row)[source]
column_key(self, column)[source]