[wip] Add the possibility to extract collections from a Frame#856
[wip] Add the possibility to extract collections from a Frame#856tmadlener wants to merge 1 commit intoAIDASoft:masterfrom
Conversation
|
This looks complicated, what's the use case? I think it only makes sense when the collection has not been written, so when the Frame has been used as temporary storage for the collections? But then any other container could be used. |
|
I would like to use this to filter collections. My use case is that I would eg like to process particles and only keep some of them, while patching up simulated hits. Currently, I have no way to do that while retaining the rest of the content of a frame from an input file to an output file. In practice, I would like to read a frame from a file, remove a number of collections while keeping the rest intact, modifying it, then put it back into that same frame, and finally write it to an output file. This is current not possible I think. |
|
I think two ways exist that may not be optimal:
Unless size is a big concern, option 1 works and you don't have to worry about the relations. Maybe we could discuss having something for either filtering or removing collections. |
|
Size is exactly what this is about. I have files where I need to strip the vast majority of particles to get that under control. I don't think either of these options work with the current API @jmcarcell, if want to keep all collections I'm not explicitly touching
Your option 1 requires me to overwrite the modified collection into the output frame, which I don't believe I can. I could possibly read an event from a frame with only the collections I want, and then again with all collections except the ones that I don't want, but from what I understand from @tmadlener this will have some impact on the relationships. So this PR is a compromise that allows me to manipulate a frame partially. |
BEGINRELEASENOTES
extractmethod to theFrameto allow removing existing collections from a Frame.ENDRELEASENOTES
This has a lot of sharp edges, but it might be useful for some tasks.
@paulgessinger FYI