-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Properties are set using setattr in the generate_tasks_from_spec function. There are a couple of downsides to this:
- Cannot set non-alphanumeric properties. For example, one might want to pass
alpha.betato the spawner in order to set properties in multi-level input files. - There is no check on
hasattrwhich means that if the property does not exist it just adds a Python property (see issue Task creation should fail if spawner doesn't have property #109). If we put a requirement on the property existing then this does not allow spawners to be dynamic in the sense that they must declare all the properties upfront.
Solution:
generate_tasks_from_spec takes two additional default argument getter and setter, which default to getattr and setattr respectively but could also be __getitem__ and __setitem__.
It might make sense to redesign this function into a callable TaskGenerator class.
Metadata
Metadata
Assignees
Labels
No labels