nel-lab / mesmerize-core

High level pandas-based API for batch analysis of Calcium Imaging data using CaImAn
Other
58 stars 15 forks source link

Allow non-hashable types and nested params in get_params_diffs #297

Closed ethanbb closed 3 months ago

ethanbb commented 3 months ago

This extends the function get_params_diffs to work when the params are nested under different groups (as caiman now expects) and/or include types that are comparable but not hashable, such as lists. (The hashability issue comes from creating a set, which requires elements to be hashable; after playing a bit with converting non-hashable types to hashable ones, I decided to bypass that entirely by just using a different method based on equality testing.)

I had to make these changes to get it to work with my existing code, where I am exporting the entire params dict from a CNMFParams object and modifying it as needed before passing to df.caiman.add_item. I figured it could help others to make this function more robust.

kushalkolar commented 3 months ago

By the way, did the lockfile stuff in your other branch work?

ethanbb commented 3 months ago

By the way, did the lockfile stuff in your other branch work?

Probably, still doing some testing though.

kushalkolar commented 3 months ago

is this good to go to merge?

ethanbb commented 3 months ago

is this good to go to merge?

Yes it should be!