Hi there,
in the following, I use these conventions.
Uppercase type = aiida Data type (e.g. List = aiida.orm.nodes.data.list.List)
Lowercase type = python/numpy type ('simple type', e.g. float, numpy.float)
'--->' provenance path maintained
'-x->' provenance path broken
In general terms,
I have a Collection of items. I want to apply them *individually* to a set of Nodes 'X'.
I want to maintain the provenance
Collection --> Nodes
However, aiida Collection Types (say, List) only store simple types.
Collection -x-> (for each) item -x-> Item ---> 'X' changed with Item
My solution to this problem is to define a CalcFunction itemize(Collection)->dict_of_items, which turns the Collection of items into a collection of Items. Then I use a Group to manage both and retrieve the latter.
Collection of items ---> itemize ---> (for each) Item ---> 'X' changed with Item
Is there are a simpler way to achieve this? I feel this approach is wrong since my scheme has data redundancy to maintain provenance. But I feel the motivation is valid.
In specific terms,
I have a List of floats. I want to apply them *individually* to a set of StructureData to rescale their lattice constants, for data augmentation.
However, aiida List Type only stores simple types.
List -x-> (for each) float -x-> Float ---> StructureData rescaled with Float
My solution to this problem is to define a CalcFunction itemize(List)->dict_of_items, which turns the List of floats into a list of Floats. Then I use a Group to manage both and retrieve the latter.
List of floats ---> itemize ---> (for each) Float ---> StructureData rescaled with Float
Thanks!