Group

class simframe.frame.Group(owner, updater=None, description='')[source]

Bases: simframe.frame.abstractgroup.AbstractGroup

Class for grouping data. Group is a data frame that has additional functionality for updating its attributes.

Notes

When Group.update() is called the instructions of the group’s Heartbeat object will be performed. The function that is determing the update operation needs the parent Frame object as first positional argument.

Attributes
description

Description of the instance.

toc

Complete table of contents starting from this object.

updateorder

Update order if updater was set with list of strings.

updater

Heartbeat object with update instructions.

Methods

addfield(name, value[, updater, …])

Function to add a new Field to the object.

addgroup(name[, updater, description])

Function to add a new Group to the object.

addintegrationvariable(name, value[, …])

Function to add a new integration variable IntVar to the object.

update(*args, **kwargs)

Function to update the object.

Attributes Summary

toc

Complete table of contents starting from this object.

updateorder

Update order if updater was set with list of strings.

updater

Heartbeat object with update instructions.

Methods Summary

addfield(name, value[, updater, …])

Function to add a new Field to the object.

addgroup(name[, updater, description])

Function to add a new Group to the object.

addintegrationvariable(name, value[, …])

Function to add a new integration variable IntVar to the object.

Attributes Documentation

toc

Complete table of contents starting from this object.

updateorder

Update order if updater was set with list of strings. None otherwise.

updater

Heartbeat object with update instructions.

You can either set a Heartbeat object directly, a callable functions that will be automatically transformed into a Heartbeat object, or a list of attribute names of the Group that will be updated in that order.

Methods Documentation

addfield(name, value, updater=None, differentiator=None, description='', constant=False, save=True, copy=True)[source]

Function to add a new Field to the object.

Parameters
  • name (string) – Name of the field

  • value (number, array, string) – Initial value of the field. Needs to have already the correct type and shape

  • updater (Heartbeat, Updater, callable or None, optional, default : None) – Updater for field update

  • differentiator (Heartbeat, Updater, callable or None, optional, default : None) – Differentiator if the field has a derivative

  • description (string, optional, default : "") – Descriptive string for the field

  • constant (boolean, optional, default : False) – True if the field is immutable

  • save (boolean, optional, default : True) – If True field will be stored in output files

  • copy (boolean, optional, default : True) – If True <value> will be copied, not referenced

addgroup(name, updater=None, description='')[source]

Function to add a new Group to the object.

Parameters
  • name (string) – Name of the group

  • updater (Heartbeat, Updater, callable or None, optional, default : None) – Updater for field update

  • description (string, optional, default : "") – Descriptive string for the group

addintegrationvariable(name, value, snapshots=[], updater=None, description='', copy=True)[source]

Function to add a new integration variable IntVar to the object.

Parameters
  • name (string) – Name of the field

  • value (number, array, string) – Initial value of the field. Needs to have already the correct type and shape

  • updater (Heartbeat, Updater, callable or None, optional, default : None) – Updater for field update

  • snapshots (list, ndarray, optional, default : []) – List of snapshots at which an output file should be written

  • description (string, optional, default : "") – Descriptive string for the field

  • copy (boolean, optional, default : True) – If True <value> will be copied, not referenced