-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from cadCAD_tools.execution import easy_run | ||
from cadCAD_tools.profiling import profile_run | ||
from cadCAD_tools.profiling import profile_run | ||
from cadCAD_tools.utils import generic_suf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from .types import Signal, StateUpdate, VariableUpdate | ||
|
||
def generic_suf(variable: str, | ||
signal: str='') -> StateUpdate: | ||
""" | ||
Generate a State Update Function that assigns the signal value to the | ||
given variable. By default, the signal has the same identifier as the | ||
variable. | ||
""" | ||
if signal is '': | ||
signal = variable | ||
else: | ||
pass | ||
|
||
def suf(_1, _2, _3, _4, signals: Signal) -> VariableUpdate: | ||
return (variable, signals[signal]) | ||
return suf |