Skip to content

Commit

Permalink
add comment clarifying use of lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
artgoldberg committed Jun 23, 2017
1 parent 516c1e8 commit 2365266
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion intro_to_wc_modeling/cell_modeling/simulation/boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# A --| B --| C --| A
################################
regulatory_functions = {
# the Python Language Reference for expressions defines the behavior of anonymous lambda functions
'A': lambda nodes: not nodes['C'],
'B': lambda nodes: not nodes['A'],
'C': lambda nodes: not nodes['B'],
Expand All @@ -40,7 +41,7 @@ def simulate(regulatory_functions, initial_state, n_steps, update_scheme):
""" Simulates a Boolean network for :obj:`n_steps` using :obj:`update_scheme`
Args:
regulatory_functions (:obj:`dict` of :obj:`str`, :obj:`function`): dictionary of regulatory functions for each species
regulatory_functions (:obj:`dict` of :obj:`str`, :obj:`function`): dictionary of regulatory lambda functions for each species
initial_state (:obj:`dict` of :obj:`str`, :obj:`bool`): dictionary of initial values of each species
n_steps (:obj:`int`): number of steps to simulate
update_scheme (:obj:`method`): update schema
Expand Down

0 comments on commit 2365266

Please sign in to comment.