From da25e7d7c606e5f017490f48860a02490dd369d5 Mon Sep 17 00:00:00 2001 From: Georg Raiser Date: Tue, 4 Mar 2025 10:16:07 +0000 Subject: [PATCH] io fix for downward compatibility to old neurophotometrics format --- src/iblphotometry/io.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/iblphotometry/io.py b/src/iblphotometry/io.py index cedf477..27abcf7 100644 --- a/src/iblphotometry/io.py +++ b/src/iblphotometry/io.py @@ -69,6 +69,10 @@ def from_raw_neurophotometrics_df_to_ibl_df( # TODO the names column in channel_meta_map should actually be user defined (experiment description file?) channel_meta_map = pd.DataFrame(LIGHT_SOURCE_MAP) led_states = pd.DataFrame(LED_STATES).set_index('Condition') + + # downward compatibility fix for older than old format + if 'Flags' in raw_df.columns: + raw_df = raw_df.rename(columns={'Flags': 'LedState'}) states = raw_df['LedState'] for state in states.unique():