From 6d61bc7e1410a757bb28f89a9659bad4e2296869 Mon Sep 17 00:00:00 2001 From: wendtalexander Date: Wed, 20 May 2026 09:42:01 +0200 Subject: [PATCH] [repros] fixing if the last repro was empty because it was to small --- oephys2nix/stimulus_recreation.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/oephys2nix/stimulus_recreation.py b/oephys2nix/stimulus_recreation.py index bcd97cf..4f88643 100644 --- a/oephys2nix/stimulus_recreation.py +++ b/oephys2nix/stimulus_recreation.py @@ -438,10 +438,19 @@ class StimulusToNix: continue last_repro_name = self.dataset.repro_runs()[i - 1].name - last_repro_position = ( - self.block.groups[last_repro_name].tags[0].position[0] - + self.block.groups[last_repro_name].tags[0].extent[0] - ) + try: + log.debug("Did find the last repro") + last_repro_position = ( + self.block.groups[last_repro_name].tags[0].position[0] + + self.block.groups[last_repro_name].tags[0].extent[0] + ) + except KeyError: + log.debug("Last repro did not exit") + log.info("Finish writing") + break + embed() + exit() + self._append_tag( repro, last_repro_position.reshape(-1, 1),