Skip to content

Commit

Permalink
allow for callable to be pased for sim_func
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDonoghue committed Aug 29, 2024
1 parent da362f7 commit c56a1dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions neurodsp/sim/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ class Simulations():
The simulated signals, organized as [n_sims, sig_length].
params : dict, optional
The simulation parameters that were used to create the simulations.
sim_func : str, optional
sim_func : str or callable, optional
The simulation function that was used to create the simulations.
If callable, the name of the function is taken to be added to the object.
Notes
-----
Expand All @@ -34,7 +35,7 @@ def __init__(self, signals=None, params=None, sim_func=None):
self._base_params = None
self._params = None
self.add_params(params)
self.sim_func = sim_func
self.sim_func = sim_func.__name__ if callable(sim_func) else sim_func

def __iter__(self):
"""Define iteration as stepping across individual simulated signals."""
Expand Down

0 comments on commit c56a1dc

Please sign in to comment.