lsst.sims.ocs.setup.tracking module

class lsst.sims.ocs.setup.tracking.Tracking(session_id, session_type, startup_comment)[source]

Bases: future.types.newobject.newobject

Main class for OpSim tracking database.

This class is responsible for interacting with the OpSim tracking database. It collects the necessary information to record the simulation session to the tracking database.

session_id

int – The simulation session ID tag.

session_type

str – The simulation session type code.

startup_comment

str – The startup comment with the associated simulation session.

log

logging.Logger – The logging instance.

opsim_tracking_url

str – The URL for the Operations Simulator tracking database.

session_type_codes

dict[str, int] – The mapping of session type codes to integer values.

Initialize the class.

Parameters:
  • session_id (int) – The current value of the simulation session ID.
  • session_type (str) – The simulation session type code.
  • startup_comment (str) – The startup comment with the associated simulation session.
track_session(hostname=None, user=None, version=None)[source]

Record the simulation session into the tracking database.

Parameters:
  • hostname (str, optional) – An alternate hostname.
  • user (str, optional) – An alternate username.
  • version (str, optional) – An alternate version number.
update_session(eng_comment, hostname=None)[source]

Update the simulation session in the tracking database with a comment.

This function allows the simulation session’s entry in the tracking database to be updated with an engineering comment. This is hopefully to record that the simulation has completed successfully, but may be used to indicate a simulation failure.

Parameters:
  • eng_comment (str) – A comment about the simulation session hopefully for a successful run.
  • hostname (str, optional) – An alternate hostname
tracking_url

str – The URL for the tracking call.

update_url

str – The URL for the update call.