nexusLIMS.harvesters.reservation_event#

A representation of calendar reservations.

This module contains a class to represent calendar reservations and associated metadata harvest metadata from various calendar sources. The expectation is that submodules of this module will have a method named res_event_from_session implemented to handle fetching a ReservationEvent object from a nexusLIMS.db.session_handler.Session object.

Module Contents#

Classes#

ReservationEvent

A representation of a single calendar reservation.

API#

class nexusLIMS.harvesters.reservation_event.ReservationEvent[source]#

A representation of a single calendar reservation.

The representation is independent of the type of calendar the reservation was made with. ReservationEvent is a common interface that is used by the record building code.

Any attribute can be None to indicate it was not present or no value was provided. The as_xml() method is used to serialize the information contained within a ReservationEvent into an XML representation that is compatible with the Nexus Facility Experiment schema.

Parameters:
  • experiment_title – The title of the event

  • instrument – The instrument associated with this reservation

  • last_updated (datetime) – The time this event was last updated

  • username – The username of the user indicated in this event

  • user_full_name – The full name of the user for this event

  • created_by – The username of the user that created this event

  • created_by_full_name – The full name of the user that created this event

  • start_time – The time this event was scheduled to start

  • end_time – The time this event was scheduled to end

  • reservation_type – The “type” or category of this event (such as User session, service, etc.)

  • experiment_purpose – The user-entered purpose of this experiment

  • sample_details – A list of the user-entered sample details for this experiment. The length of the list must match that given in sample_pid and sample_name.

  • sample_pid – A list of sample PIDs provided by the user. The length of the list must match that given in sample_details and sample_name.

  • sample_name – A list of user-friendly sample names (not a PID). The length of the list must match that given in sample_details and sample_pid.

  • project_name – A list of the user-entered project names for this experiment. The length of the list must match that given in project_id and project_ref.

  • project_id – A list of the specific project IDs within a research group/division. The length of the list must match that given in project_name and project_ref.

  • project_ref – A list of (optional) links to this project in another database. The length of the list must match that given in project_name and project_id.

  • internal_id – The identifier assigned to this event (if any) by the calendaring system

  • division – An identifier of the division this experiment was performed for (i.e. the user’s division)

  • group – An identifier of the group this experiment was performed for (i.e. the user’s group)

  • url – A web-accessible link to a summary of this reservation

experiment_title#

Type: str | None

instrument#

Type: nexusLIMS.instruments.Instrument | None

last_updated#

Type: datetime.datetime | None

username#

Type: str | None

user_full_name#

Type: str | None

created_by#

Type: str | None

created_by_full_name#

Type: str | None

start_time#

Type: datetime.datetime | None

end_time#

Type: datetime.datetime | None

reservation_type#

Type: str | None

experiment_purpose#

Type: str | None

sample_details#

Type: typing.List[str | None] | None

sample_pid#

Type: typing.List[str | None] | None

sample_name#

Type: typing.List[str | None] | None

sample_elements#

Type: typing.List[typing.List[str] | None] | None

project_name#

Type: typing.List[str | None] | None

project_id#

Type: typing.List[str | None] | None

project_ref#

Type: typing.List[str | None] | None

internal_id#

Type: str | None

division#

Type: str | None

group#

Type: str | None

url#

Type: str | None

as_xml() Element[source]#

Get an XML representation of this ReservationEvent.

Returns:

root – The reservation event serialized as XML that matches the Nexus Experiment schema

Return type:

Element