SimFactory.ModelMock() return a list of entities created. From a user's point of view, it would make more sense that
SimFactory.ModelMock() returns a single instance, because it looks like a normal class instantiation. However, in cases where you want to create, e.g., a power grid and get a number of buses and branches in return, obviously doesn't work.
The two possible solutions for this are
- Always return a list of entities (current implementation)
- Allow hierarichical entity sets. In the example above, this would return a PowerGrid entity with the buses and branches stored in sub-entitysets.
If we switch from lists of entities to an
EntiySet data structure as a wrapper around multiple entities (see also issue
#13), the second approach may become more feasible. On the other hand, the return value of the
init() API call (which is currently a playin list of dicts) may becore more complicated.