open-autonomy
open-autonomy copied to clipboard
Timeout assignment in SharedState
trafficstars
It will better to not task a developer with assigning each timeout manually in the setup of the SharedState. We should abstract this away as this can happen completely automatically on instantiation.
spun from PR on keep3r associated Trello ticket
for event, default_seconds in ABCIApp.event_to_timeout.items():
overwrite_seconds = getattr(self.context.params, str(event), None)
# skill = ... # <<< should really log this too
if overwrite_seconds:
timeouts_to_events[event] = overwrite_seconds
logging.info(f"{event} using overwrite: {overwrite_seconds}")
else:
timeouts_to_events[event] = default_seconds
logging.info(f"{event} using default: {default_seconds}")
can associate skill with event more clearly too
class Event(Enum):
...
@property
def skill_public_id(self):
author, skill = some_func(self.__module__)
return PublicId(author, skill) # or import from `__init__.py` ...