mxcubecore.HardwareObjects.abstract.AbstractLims#

Classes

AbstractLims(name)

Interface for LIMS integration

class mxcubecore.HardwareObjects.abstract.AbstractLims.AbstractLims(name)[source]#

Bases: HardwareObject, ABC

Interface for LIMS integration

add_user_and_shared_sessions(user_name: str, sessions: List[Session])[source]#

Stores the username and the shared sessions in the session manager object. The shared sessions represent the intersection of all sessions for each user currently connected.

Parameters:
  • user_name (str) –

  • sessions (List[Session]) –

abstract create_session(proposal_tuple: LimsSessionManager) LimsSessionManager[source]#

TBD

Parameters:

proposal_tuple (LimsSessionManager) –

Return type:

LimsSessionManager

abstract echo() bool[source]#

Returns True of LIMS is responding

Return type:

bool

abstract finalize_data_collection(datacollection_dict: dict) Tuple[int, int][source]#

Finalizes the collection with “collection_id”, provided in datacollection_dict.

Strucure of datacollection_dict as defined in store_data_collection above.

Parameters:

datacollection_dict (dict) –

Return type:

Tuple[int, int]

get_active_session() Session[source]#

Returns Currently active session

Return type:

Session

abstract get_full_user_name() str[source]#

Returns the user name of the current user

Return type:

str

abstract get_lims_name() List[Lims][source]#

Returns the LIMS used, name and description

Return type:

List[Lims]

abstract get_proposals_by_user(login_id: str) List[Dict][source]#

Returns a list with proposal dictionaries for login_id

Proposal dictionary structure:
{

“Proposal”: proposal, “Person”: , “Laboratory”:, “Session”:,

}

Parameters:

login_id (str) –

Return type:

List[Dict]

abstract get_samples(lims_name: str) List[Dict][source]#

Returns a list of sample dictionaries for the current user from lims_name

Structure of sample dictionary: {

“containerCode”: str, “containerSampleChangerLocation”: int, “crystalId”: int, “crystalSpaceGroup”: str, “diffractionPlan”: {

“diffractionPlanId”: int

},

“proteinAcronym”: “str, “sampleId”: int, “sampleLocation”: int, “sampleName”: str

}

Parameters:

lims_name (str) –

Return type:

List[Dict]

get_session_id() str[source]#

Returns the currently active LIMS session id

Return type:

str

abstract get_user_name() str[source]#

Returns the user name of the current user

Return type:

str

init() None[source]#

Method inherited from baseclass

Return type:

None

is_scheduled_now(start_date: str, end_date: str) bool[source]#

TBD

Parameters:
  • start_date (str) –

  • end_date (str) –

Return type:

bool

is_scheduled_on_host_beamline(beamline: str) bool[source]#

TBD

Parameters:

beamline (str) –

Return type:

bool

is_time_between(start_date: str, end_date: str, check_time=None)[source]#

TBD

Parameters:
  • start_date (str) –

  • end_date (str) –

abstract is_user_login_type() bool[source]#

Returns True if the login type is user based (not done with proposal)

Return type:

bool

abstract login(login_id: str, password: str, create_session: bool) List[Session][source]#

Login to LIMS, returns a list of Session objects for login_id

Parameters:
  • login_id (str) – username

  • password (str) – password

  • create_session (bool) – True if session should be created by LIMS if it does not exist otherwise False

Return type:

List[Session]

set_active_session_by_id(session_id: str) Session[source]#

Sets session with session_id to active session

Parameters:

session_id (str) – session id

Return type:

Session

abstract store_beamline_setup(session_id: str, bl_config_dict: dict) int[source]#

Stores the beamline setup dict bl_config_dict for session_id

Parameters:
  • session_id (str) – The session id that the beamline_setup should be associated with.

  • bl_config_dict (dict) – The dictonary with beamline settings.

Returns:

The id of the beamline setup.

Return type:

int

abstract store_data_collection(datacollection_dict: dict, beamline_config_dict: Dict | None) Tuple[int, int][source]#

Stores a datacollection, datacollection_dict, and beamline configuration, beamline_config_dict, at the time of collection

Structure of datacollection_dict: {

“oscillation_sequence”:[{}

“start”: float, “range”: float, “overlap”: float, “number_of_imaages”: float, “start_image_number”: float “exposure_time”, float, “kappaStart”: float, “phiStart”: float,

}], “fileinfo:{

“direcotry: str, “prefix”: str “suffix”: str, “template: str, “run_number” int

} “status”: str, “collection_id: int, “wavelenght: float, “resolution”:{

“lower”: float, “upper”: float

}, “resolutionAtCorner”: float, “detectorDistance”: float “xBeam”: float, “yBeam”: float, “beamSizeAtSampleX”: float “beamSizeAtSampleY”: float, “beamShape”: str, “slitGapHorizontal”: float, “slitGapVertical”: float, “synchrotronMode”, float, “flux”: float, “flux_end”: float, “transmission” float, “undulatorGap1”: float “undulatorGap2”: float “undulatorGap3”: float “xtalSnapshotFullPath1”: str, “xtalSnapshotFullPath2”: str, “xtalSnapshotFullPath3”: str, “xtalSnapshotFullPath4”: str, “centeringMethod”: str, “actualCenteringPosition” str “group_id: int, “detector_id”: int, “screening_sub_wedge_id”: int, “collection_start_time”: str #”%Y-%m-%d %H:%M:%S”

}

Structure of beamline_config_dict: {

“synchrotron_name”:str, “directory_prefix”:str, “default_exposure_time”:str, “minimum_exposure_time”:str, “detector_fileext”:str, “detector_type”:str, “detector_manufacturer”:str, “detector_binning_mode”:str, “detector_model”:str, “detector_px”:int, “detector_py”:int, “undulators”:str, “focusing_optic”:str, “monochromator_type”:str, “beam_divergence_vertical”:float, “beam_divergence_horizontal”:float, “polarisation”:float, “maximum_phi_speed”:float, “minimum_phi_oscillation”:float, “input_files_server”:str,

}

Parameters:
  • datacollection_dict (dict) – As defined above

  • beamline_config_dict (Dict | None) – As defined above

Returns:

Tuple data_collection_id, detector_id

Return type:

Tuple[int, int]

abstract store_energy_scan(energyscan_dict: dict) None[source]#

Store energyscan data

Parameters:

energyscan_dict (dict) – Energyscan data to store.

Returns:

int}

Return type:

Dictonary with the energy scan id {“energyScanId”

abstract store_image(image_dict: dict) None[source]#

Stores (image parameters) <image_dict>

Parameters:

image_dict (dict) – A dictonary with image pramaters.

Return type:

None

abstract store_robot_action(robot_action_dict: dict)[source]#

Stores the robot action dictionary.

Structure of robot_action_dictionary: {

“actionType”:str, “containerLocation”: str, “dewarLocation”:str, “message”:str, “sampleBarcode”:str, “sessionId”:int, “sampleId”:int. “startTime”:str, “endTime”:str, “xtalSnapshotAfter:str”, “xtalSnapshotBefore:str”,

}

Parameters:

robot_action_dict (dict) – robot action dictionary as defined above

abstract store_workflow(workflow_dict: dict) Tuple[int, int, int][source]#

Stores worklflow data workflow_dict

Structure of workflow_dict: {

“workflow_id”: int, “workflow_type”: str, “comments”: str, “log_file_path”: str, “result_file_path”: str, “status”: str, “title”: str, “grid_info_id”: int, “dx_mm”: float, “dy_mm”: float, “mesh_angle”: float, “steps_x”: float, “steps_y”: float, “xOffset”: float, “yOffset”: float,

}

Parameters:

workflow_dict (dict) – worklflow data on the format above

Returns:

Tuple of ints workflow_id, workflow_mesh_id, grid_info_id

Return type:

Tuple[int, int, int]

abstract store_xfe_spectrum(xfespectrum_dict: dict)[source]#

Stores a XFE spectrum.

Parameters:

xfespectrum_dict (dict) – XFE scan data to store.

Returns:

int}

Return type:

Dictonary with the XFE scan id {“xfeFluorescenceSpectrumId”

abstract update_data_collection(datacollection_dict: dict) Tuple[int, int][source]#

Updates the collection with “collection_id”, provided in datacollection_dict.

Structure of datacollection_dict as defined in store_data_collection above.

Parameters:

datacollection_dict (dict) –

Return type:

Tuple[int, int]