Skip to content

Commit

Permalink
bugfix: pregenerated session index cycles to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
oliche committed Jul 26, 2022
1 parent 76a0ba5 commit fa8097a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion iblrig/iotasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import iblrig.raw_data_loaders as raw

log = logging.getLogger("iblrig")
N_PREGENERATED_SESSIONS = 12


class ComplexEncoder(json.JSONEncoder):
Expand Down Expand Up @@ -145,7 +146,7 @@ def load_session_order_idx(last_settings_data: dict) -> tuple:
session_idx = 0
elif "SESSION_ORDER" in last_settings_data.keys():
session_order = last_settings_data["SESSION_ORDER"]
session_idx = last_settings_data["SESSION_IDX"] + 1
session_idx = (last_settings_data["SESSION_IDX"] + 1) % N_PREGENERATED_SESSIONS

return session_order, session_idx

Expand Down

0 comments on commit fa8097a

Please sign in to comment.