This PR cleans up the interface for the EventManager class, adding a new friendly add_event method and deprecating TrialEventTicket and register_ticket. The start_clock and stop_clock methods have also been renamed to start and reset, respectively. The docs have also been heavily revised for clarity.
Basically, this rewrites the EventManager class so that it's simpler and more useful/understandable as a stand-alone class. It's more-or-less what I'd write for an event manager class if I started fresh, except for methods/aliases keeping compatibility with existing code. Unit tests have also been added for the EventManager class to ensure nothing obvious was broken by the cleanup and revisions here.
Minor fixes/cleanup to the KLTime module have been made here as well.
Added:
EventManager.add_event
EventManager.start
EventManager.reset
EventManager.time_elapsed
KLTime.time_msec
Unit tests for EventManager
Deprecated:
TrialEventTicket
EventManager.register_ticket
EventManager.register_tickets
EventManager.start_clock
EventManager.stop_clock
EventManager.trial_time
EventManager.trial_time_ms
Removed:
EventManager.registered
KLEnvironment.evm
EnvAgent.evm
Merge Checklist
[x] the PR has been reviewed and all comments are resolved
PR Description
This PR cleans up the interface for the EventManager class, adding a new friendly
add_event
method and deprecatingTrialEventTicket
andregister_ticket
. Thestart_clock
andstop_clock
methods have also been renamed tostart
andreset
, respectively. The docs have also been heavily revised for clarity.Basically, this rewrites the
EventManager
class so that it's simpler and more useful/understandable as a stand-alone class. It's more-or-less what I'd write for an event manager class if I started fresh, except for methods/aliases keeping compatibility with existing code. Unit tests have also been added for theEventManager
class to ensure nothing obvious was broken by the cleanup and revisions here.Minor fixes/cleanup to the KLTime module have been made here as well.
Added:
EventManager.add_event
EventManager.start
EventManager.reset
EventManager.time_elapsed
KLTime.time_msec
EventManager
Deprecated:
TrialEventTicket
EventManager.register_ticket
EventManager.register_tickets
EventManager.start_clock
EventManager.stop_clock
EventManager.trial_time
EventManager.trial_time_ms
Removed:
EventManager.registered
KLEnvironment.evm
EnvAgent.evm
Merge Checklist
closes #<issue-number>
to automatically close an issue