Ticket #5691 (closed: fixed)
Size calculation on PropertyWithValue<vector<vector<T>>
Reported by: | Peter Parker | Owned by: | Owen Arnold |
---|---|---|---|
Priority: | major | Milestone: | Release 2.3 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | #5212 | |
Blocking: | Tester: | Roman Tolchenov |
Description
The MultipleFileProperty class is templated on std::vector<std::vector<std::string>> and as such is untouched by the changes made to #5592.
In the general case there may be little debate about what the "size" of a std::vector<std::vector<T>> object is, but in the specific case of MultipleFileProperty it is not as straight-cut:
- The cumulative size of the inner vectors denotes the total number of files that are to be loaded.
- Since the filenames contained in the inner vectors are to be added together, the number of inner vectors denotes the corresponding number of workspaces once the files have been loaded.
For example the vector of vectors
[["TSC00005", "TSC00006"] , "TSC00009"]
would denote three files in total, but would correspond to only two workspaces once they had been loaded since runs 5 and 6 would have been added together.
Going with the former as the convention would seem reasonable, but the latter would also be useful within the code.
Change History
comment:4 Changed 8 years ago by Owen Arnold
refs #5691 SliceViewer range on slice
Changeset: eb1b8047884a12c9211c35409ef8934cba4934d2
This commit should have gone against #5359
comment:5 Changed 8 years ago by Owen Arnold
refs #5691 SliceViewer range on slice
Changeset: eb1b8047884a12c9211c35409ef8934cba4934d2
comment:6 Changed 8 years ago by Owen Arnold
refs #5691. Assert this is doing the right thing.
Changeset: a7540008cf40395b5ce978bd52dd6f60cd8376e0
comment:7 Changed 8 years ago by Owen Arnold
- Status changed from accepted to verify
- Resolution set to fixed
The news size function overloads are already doing the right thing. I've added a test to verify that this is the case.
Tester: See the new unit test breakdown as a guide.
comment:8 Changed 8 years ago by Roman Tolchenov
- Status changed from verify to verifying
- Tester set to Roman Tolchenov
comment:10 Changed 8 years ago by Owen Arnold
refs #5691. Assert this is doing the right thing.
Changeset: a7540008cf40395b5ce978bd52dd6f60cd8376e0
comment:11 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 6537
The MultipleFileProperty will be affected by changes made in #5592 because overloading and template argument deduction on these partially specialised functions provide a better match for the vector type input for both vector<T> and vector<vector<T> > than the more generic T overlaod. However, this ticket raises a good point, and we should do something to correctly calculate the sizes for the MultipleFileProperty based on the rules outlined in this ticket.