PYME.IO.events module¶
- class PYME.IO.events.EventLogger(time_fcn=<built-in function time>)¶
Bases:
object
Event logging backend base class
- Parameters
- time_fcnfunction, default=time.time
function used to generate event timestamps. Pass a different function to, e.g. spoof timestamps when simulating.
- classmethod list_to_array(event_list)¶
- logEvent(eventName, eventDescr='', timestamp=None)¶
Log an event. Should be overriden in derived classes.
Note
In addition to the name and description, timing information is recorded for each event.
- Parameters
- eventNamestring
short event name - < 32 chars and should be shared by events of the same type.
- eventDescrstring
description of the event - additional, even specific information packaged as a string (<255 chars). This is commonly used to store parameters - e.g. z positions, and should be both human readable and easily parsed.
- class PYME.IO.events.HDFEventLogger(spool, hdf5File, time_fcn=<built-in function time>)¶
Bases:
EventLogger
Event logging backend for hdf/pytables data storage
- Parameters
- spoolinstance of HDFSpooler.Spooler
The spooler to ascociate this logger with
- hdf5Filepytables hdf file
The open HDF5 file to write to
Create a new Events table.
- logEvent(eventName, eventDescr='', timestamp=None)¶
Log an event.
- Parameters
- eventNamestring
short event name - < 32 chars and should be shared by events of the same type.
- eventDescrstring
description of the event - additional, even specific information packaged as a string (<255 chars). This is commonly used to store parameters - e.g. z positions, and should be both human readable and easily parsed.
- In addition to the name and description, timing information is recorded
- for each event.
- class PYME.IO.events.MemoryEventLogger(spooler, time_fcn=<built-in function time>)¶
Bases:
EventLogger
Event backend which records events to memory, to be saved at a later time
- Parameters
- time_fcnfunction, default=time.time
function used to generate event timestamps. Pass a different function to, e.g. spoof timestamps when simulating.
- logEvent(eventName, eventDescr='', timestamp=None)¶
Log an event. Should be overriden in derived classes.
Note
In addition to the name and description, timing information is recorded for each event.
- Parameters
- eventNamestring
short event name - < 32 chars and should be shared by events of the same type.
- eventDescrstring
description of the event - additional, even specific information packaged as a string (<255 chars). This is commonly used to store parameters - e.g. z positions, and should be both human readable and easily parsed.
- to_JSON()¶
- to_recarray()¶
- class PYME.IO.events.QueueEventLogger(spool, tq, queueName, time_fcn=<built-in function time>)¶
Bases:
EventLogger
Event backend for TaskQueue (Pyro) based spooling
Exists for Py27 backwards compatibility and does not work on py3. Don’t use in new code.
- Parameters
- time_fcnfunction, default=time.time
function used to generate event timestamps. Pass a different function to, e.g. spoof timestamps when simulating.
- logEvent(eventName, eventDescr='', timestamp=None)¶
Log an event. Should be overriden in derived classes.
Note
In addition to the name and description, timing information is recorded for each event.
- Parameters
- eventNamestring
short event name - < 32 chars and should be shared by events of the same type.
- eventDescrstring
description of the event - additional, even specific information packaged as a string (<255 chars). This is commonly used to store parameters - e.g. z positions, and should be both human readable and easily parsed.