Skip to content

Commit

Permalink
allow continue_run=True on first multimodel run
Browse files Browse the repository at this point in the history
  • Loading branch information
1b15 committed Mar 12, 2024
1 parent bd6dbdc commit 85b5ea9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions neurolib/models/multimodel/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,11 @@ def integrate(self, append_outputs=False, simulate_bold=False, noise_input=None)
self.simulateBold(result[self.default_output].values.T, append=True)

def setInitialValuesToLastState(self):
if not hasattr(self, "t"):
raise ValueError("You tried using continue_run=True on the first run.")
if not self.state:
logging.warning(
f"`setInitialValuesToLastState` was called, but the state dict is empty. This is probably caused by `continue_run=True` on the first model run."
)
return
new_initial_state = np.zeros((self.model_instance.initial_state.shape[0], self.maxDelay + 1))
total_vars_counter = 0
for node_idx, node_vars in enumerate(self.state_vars):
Expand Down

0 comments on commit 85b5ea9

Please sign in to comment.