Open Brow71189 opened 4 years ago
Doesn't new_data_item
do this already?
new_data_item
does that only when you pass in data with more than 2 dimensions. Computations create an empty data_item first and populate it later (see the link in my first comment). In this case, the created data_item is NOT of large_format. Since it is impossible to know what kind of data will be put into the data_item, we either have to have the option to specify this explicitly, or make "large_format" the default. Would the latter option have any major disadvantages?
The issue is that the size of the data is not known at the time the data item is created. So there needs to be some mechanism of updating the storage format when the data size is first determined. This can be when the data is set or when space is reserved.
Also needs test cases.
https://github.com/nion-software/nionswift/blob/db37dfebc7146497c4b7ad2bb547bf28f0f9cb82/nion/swift/model/DocumentModel.py#L2395