Shortcut#
The available shortcuts:
|
Shortcut to add a loop to a subgraph. |
|
Shortcut to add print modifiers to nodes. |
shortcut
module#
Shortcuts
The shortcut should work for both the Model and the Experiment classes.
- mmodel.shortcut.loop_shortcut(model, parameter: str, name=None)[source]#
Shortcut to add a loop to a subgraph.
The parameter needs to be in the graph signature. Otherwise, an exception is raised. For parameters that are not from the graph (signature modified by modifiers), use regular loops or change modifiers.
- Parameters:
model – executable model
parameter (str) – loop parameter
name (str) – name of the new model, defaults to old model name.
- Returns:
a new model with looped parameter
- mmodel.shortcut.print_shortcut(model, stdout_format_list, **pargs)[source]#
Shortcut to add print modifiers to nodes.
- Parameters:
model – mrfmsim experiment
stdout_format_list (list) – list of format strings each format string should only contain one variable.
If the variable is not in the inputs or outputs of the nodes, the variable is ignored. The printout prioritizes inputs in a node. If a parameter is a node input and output, the first occurrence is used (when it is the output of the node). The decision to make all output the same setting (pargs for print()) is to simplify the implementation. If the user wants to have customized printout behavior, use the regular modifier for each node.