nion-software / nionswift

Nion Swift is open source scientific image processing software integrating hardware control, data acquisition, visualization, processing, and analysis using Python. Nion Swift is easily extended using Python. It runs on Windows, Linux, and macOS.
http://nion.com/swift
GNU General Public License v3.0
43 stars 33 forks source link

Redefine how data-item UUID's are used; introduce data UUID #1044

Open cmeyer opened 1 month ago

cmeyer commented 1 month ago

The data-item UUID is used for multiple purposes - but it's only legitimate use is to uniquely identify each data item in a project and allow other items (computations, displays, etc.) to reference it persistently.

Using the data-item UUID to identify duplicate data items does not work. e.g. export the same data item twice, create new project, import both files. One will fail to import due to being the same UUID.

To resolve many related issues, I propose that we introduce a data UUID and possibly a data-and-metadata UUID to be used for identifying the data and leave the data-item UUID for its legitimate use.

### Tasks
- [ ] import should assign new data-item uuid when importing
- [ ] data-item-uuid should not be used to distinguish data
- [ ] data-uuid should be introduced, it never changes but is associated with data, not data-item; it gets cloned
- [ ] data-and-metadata-uuid should be introduced, changes when either data or its metadata changes; it gets cloned
- [ ] data-modified updates when data is modified; it gets cloned
- [ ] snapshot clones data-uuid, data-modified, and data-and-metadata-uuid, but not data-item-uuid
- [ ] matching data-uuid + data-and-metadata-uuid means an identical data item
- [ ] deleting data items does not remove their data-item uuid from existing set currently; it should
- [ ] data-and-metadata-uuid is used for uniqueness only, should not be referenced directly