mstar.utils.containers#
Small generic containers with no engine or worker knowledge
Classes
|
Struct-of-arrays pairing, so a batch crosses a language boundary as two flat lists instead of a dict of objects. |
|
Set of the |
- class mstar.utils.containers.ParallelList(keys, values)[source]#
Bases:
NamedTuple,Generic[TK,TV]Struct-of-arrays pairing, so a batch crosses a language boundary as two flat lists instead of a dict of objects.
Two sharp edges come from the field names plus the custom
__iter__:dict(pl)does NOT work.dictprobes for a.keys()method to decide whether it was handed a mapping; herekeysis a list attribute, so it raises'list' object is not callable. Usedict(iter(pl)).k, v = pldoes not give the two lists – see__iter__.
- classmethod from_dict(d)[source]#
- Parameters:
d (dict[TK, TV])
- Return type:
ParallelList[TK, TV]