znamlab / flexiznam

Znam lab tool to interact with flexilims
https://flexiznam.znamlab.org/
MIT License
0 stars 0 forks source link

Refactor name to add genealogy #84

Closed ablot closed 2 years ago

ablot commented 2 years ago

Parsing any flexilims name is impossible. Underscores separate different levels but can also be present inside a level name. While we had a semi-working version with 2P data, it because totally unworkable with sample. Similarly finding a session name from a dataset is difficult (because it requires parsing or calling parents multiple times and checking type). To solve both issue, add to every entity a genealogy attributes that is the list of elements composing the flexilims name. For instance the genealogy for 'BRAC34_S22_headfixed_R12_Retinotopy_harp_data' is ['BRAC34', 'S22_headfixed', 'R12_Retinotopy', 'harp_data'].

This required quite a large refactoring of dataset and sync_yaml but seems to work (all tests passing locally). The helper function utils.add_genealogy is slow but should add all missing genealogy info from existing flexilims entries.

ablot commented 2 years ago

This should solve the issues you had @yiran25 (to find dataset names and other part of flexilims names).

@znamensk and @yiran25, could you review the CHANGELOG.md and tell if any of the changes sound like a bad idea? I can revert some (for instance put back Dataset.name)