mpacts.tools. gateparse

Small utility module that returns mpacts ‘gates’ from dictionary that specify the gate’s name

In order to be able to use this module import it like this:

import mpacts.tools.gateparse
#or assign it to a shorter name
import mpacts.tools.gateparse as gat
mpacts.tools.gateparse.get_gate(namedict, top_parent)

Given a dictionary with arguments (passed e.g. to a particle container command), will return an mpacts gate (CommandGateBase) with the appropriate gate parameters

Parameters:
  • namedict – Dictionary containing ‘types’ of gate and their properties. Accepted are: ‘executeOnce’, ‘executeEvery’, ‘executeInterval’ and ‘executeTimes’.
  • top_parent – Parent level object (e.g. the simulation itself), which is used to extract e.g. timestep information for certain gate types.
mpacts.tools.gateparse.set_gate_on_cmd(namedict, cmd, top_parent)

From a dictionary, produces an mpacts gate (see get_gate() for information) and sets it to a given command (cmd)