EnnyvanBeest / UnitMatch

Ephys toolbox to match single units (electrophysiology) either within the same day (over splits) or across two days
Other
43 stars 9 forks source link

Key error in the original code #80

Closed vasilisazhukova closed 3 weeks ago

vasilisazhukova commented 3 weeks ago

Hello,

I ran UnitMatch code "UMPy_example" on the data from UCL course for UnitMatch block. The code was without modifications. Everything was fine until I wanted to save results. I received a key error when I ran the analysis without changes of labels in gui, with changes in gui, after replacement "matches" with "matches_manual", without this replacement. I also tryed to change the mode of util.curate_matches from "and" to "or", but this key error with ids remained. However, some files were saved in the output directory. Could you please help me to solve this error? error in data saving data after UnitMatch

cbimbo commented 3 weeks ago

Hi,

Could you please check what's in clus_info, by printing clus_info.keys()? Also, could you please check and copy/paste here your line that creates clus_info? It should be: clus_info = {'good_units' : good_units, 'session_switch' : session_switch, 'session_id' : session_id, 'original_ids' : np.concatenate(good_units) }

Thanks!

vasilisazhukova commented 3 weeks ago

Sure. clus_info

It looks like I have 'original_id' instead of 'original_ids', right?

cbimbo commented 3 weeks ago

Yes! Just to make sure I understand, could you please send a copy/screenshot of the line at the beginning of your notebook that's just below # Create clus_info, contains all unit id/session related info?

vasilisazhukova commented 3 weeks ago

Here, it is. create clus_info

vasilisazhukova commented 3 weeks ago

After I replaced clus_info, I received an error in assign_unique_id unique_id

cbimbo commented 3 weeks ago

Can you please make sure you have the latest version of UnitMatch installed? I can't replicate the issue with a fresh install. Maybe try removing the UnitMatch env and then doing the steps indicated in the assignment again?

vasilisazhukova commented 3 weeks ago

@cbimbo Thank you for your reply. Today I removed the UnitMatch environment and reinstalled the new one with commands provided here for UnitMatchPy. I restarted my PC and repeated the analysis. Again, I received key errors: _assign_newunits requires 'original_id' and _save_tooutput - 'original_ids'. Could you please check files of these functions?

cbimbo commented 3 weeks ago

This is very confusing. Both functions indeed have "original_ids"

What branch are you on?

Sam-Dodgson commented 3 weeks ago

Hi, previous version 2.13-2.15 had some conflicts with the key errors (original_id vs original_ids) This should be fixed could you try pip list in your notebook to see what version of UnitMatchPy it is, and if it is not 2.16 please run pip install UnitMatchPy --upgrade .

vasilisazhukova commented 3 weeks ago

@Sam-Dodgson That was my case, thank you. I don't have this error after UnitMatch upgrade.