sisl.mixing.History

class sisl.mixing.History(history=2, variables=2)

Bases: object

A history class for retaining a set of history elements

A history class may contain several different variables in a collections.deque list allowing easy managing of the length of the history.

variables

number of different variables stored as a history

Type

int

history_max

maximum number of history elements

Type

int or tuple of int

Parameters
  • history (int, optional) – number of maximum history elements stored

  • variables (int, optional) – number of different variables stored as a history.

Methods

append(*args[, variable])

Add variables to the history

clear([index, variables])

Clear variables to the history

history

Number of elements in the history

history_max

Maximum number of elements stored in the history for each variable

variables

Number of different variables that can be contained

__init__(history=2, variables=2)[source]
append(*args, variable=None)[source]

Add variables to the history

Parameters
  • *args (tuple of object) – each variable will be added to the history of the mixer

  • variable (int or listlike of int) – specify which variables the history should be added to, note: len(args) == len(variable)

clear(index=None, variables=None)[source]

Clear variables to the history

Parameters
  • index (int or array_like of int) – which indices of the history we should clear

  • variables (int or array_like of int) – specify which variables should be cleared

property history

Number of elements in the history

property history_max

Maximum number of elements stored in the history for each variable

property variables

Number of different variables that can be contained