hio.base.tyming
hio.core.tyming Module
Module Contents
Classes
Tymist keeps artificial or simulated or cycle time, called tyme. |
|
Tymee has .tyme property that returns the artificial or simulated or cycle time |
|
Tymer class to measure cycle time given by .tyme property of Tymist instance. |
- class hio.base.tyming.Tymist(tyme=0.0, tock=None, **kwa)[source]
Bases:
hio.hioing.MixinTymist keeps artificial or simulated or cycle time, called tyme. Provides relative cycle time, tyme, in seconds with .tyme property in incremets of .tock seconds. .tyme is advanced one .tock increment with .tick method. .tyme may be synchronized with real time by a .tyme manager
- Class Attributes:
.Tock is default .tock
Attributes:
- Properties:
.tyme is float relative cycle time, .tyme is artificial time .tock is float tyme increment of .tick()
- .tick increments .tyme by one .tock or provided tock
- property tock(self)[source]
tock property getter, get ._tock .tock is float cycle time .tyme increment in seconds
- class hio.base.tyming.Tymee(tymth=None, **kwa)[source]
Bases:
hio.hioing.MixinTymee has .tyme property that returns the artificial or simulated or cycle time from its referenced Tymist instance ._tymist.
Attributes:
- Properties:
- .tyme is float relative cycle time of associated Tymist .tyme obtained
via injected .tymth function wrapper closure.
- .tymth is function wrapper closure returned by Tymist .tymeth() method.
When .tymth is called it returns associated Tymist .tyme. .tymth provides injected dependency on Tymist tyme base.
- .wind injects ._tymth dependency from associated Tymist to get its .tyme
- Hidden:
- ._tymth is injected function wrapper closure returned by .tymen() of
associated Tymist instance that returns Tymist .tyme. when called.
- class hio.base.tyming.Tymer(duration=None, start=None, **kwa)[source]
Bases:
TymeeTymer class to measure cycle time given by .tyme property of Tymist instance. tyme is relative cycle time either artificial or real
Inherited Attributes
Attributes:
- Inherited Properties:
- .tyme is float relative cycle time of associated Tymist .tyme obtained
via injected .tymth function wrapper closure.
- .tymth is function wrapper closure returned by Tymist .tymeth() method.
When .tymth is called it returns associated Tymist .tyme. .tymth provides injected dependency on Tymist tyme base.
- Properties:
.duration = tyme duration of tymer in seconds from ._start to ._stop .elaspsed = tyme elasped in seconds since ._start .remaining = tyme remaining in seconds until ._stop .expired = True if expired, False otherwise, i.e. .tyme >= ._stop
- Inherited Methods:
.wind is injects ._tymth dependency
- .start() = start tymer at current .tyme
- .restart() = restart tymer at last ._stop so no time lost
- Hidden:
- ._tymth is injected function wrapper closure returned by .tymen() of
associated Tymist instance that returns Tymist .tyme. when called.
._start is start tyme in seconds ._stop is stop tyme in seconds
- property duration(self)[source]
duration property getter, .duration = ._stop - ._start .duration is float duration tyme
- property elapsed(self)[source]
elapsed tyme property getter, Returns elapsed tyme in seconds (fractional) since ._start.
- property remaining(self)[source]
remaining tyme property getter, Returns remaining tyme in seconds (fractional) before ._stop.
- property expired(self)[source]
Returns True if tymer has expired, False otherwise. .tyme >= ._stop,
- wind(self, tymth)[source]
Inject new ._tymist and any other bundled tymee references Update any dependencies on a change in ._tymist:
starts over itself at new ._tymists time