mxcubecore.HardwareObjects.mockup.ISPyBClientMockup#

A client for ISPyB Webservices.

Classes

ISPyBClientMockup(name)

Web-service client for ISPyB.

class mxcubecore.HardwareObjects.mockup.ISPyBClientMockup.ISPyBClientMockup(name)[source]#

Bases: ProposalTypeISPyBLims

Web-service client for ISPyB.

create_session(proposal)[source]#

TBD

getProposal(proposal_code, proposal_number)#

Returns the tuple (Proposal, Person, Laboratory, Session, Status). Containing the data from the corresponding tables in the database the status of the database operations are returned in Status.

Parameters:
  • proposal_code (str) – The proposal code

  • proposal_number (int) – The proposal number

Returns:

The dict (Proposal, Person, Laboratory, Sessions, Status).

Return type:

dict

get_proposal(proposal_code, proposal_number)[source]#

Returns the tuple (Proposal, Person, Laboratory, Session, Status). Containing the data from the corresponding tables in the database the status of the database operations are returned in Status.

Parameters:
  • proposal_code (str) – The proposal code

  • proposal_number (int) – The proposal number

Returns:

The dict (Proposal, Person, Laboratory, Sessions, Status).

Return type:

dict

get_proposals_by_user(user_name)[source]#

Returns a list with proposal dictionaries for login_id

Proposal dictionary structure:
{

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

}

get_samples(lims_name)[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

}

init()[source]#

Method inherited from baseclass

isInhouseUser(proposal_code, proposal_number)[source]#

Returns True if the proposal is considered to be a in-house user.

Parameters:
  • proposal_code (str) –

  • proposal_number (str) –

Return type:

bool

is_user_login_type()[source]#

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

login(user_name: str, password: str, is_local_host: bool) LimsSessionManager[source]#

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

Parameters:
  • login_id – username

  • password (str) – password

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

  • user_name (str) –

  • is_local_host (bool) –

Return type:

LimsSessionManager

storeBeamLineSetup(session_id, bl_config)#

Stores the beamline setup dict <bl_config>.

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

  • bl_config (dict) – The dictionary with beamline settings.

Returns beamline_setup_id:

The database id of the beamline setup.

Return type:

str

storeDataCollection(mx_collection, bl_config=None)#

Stores the data collection mx_collection, and the beamline setup if provided.

Parameters:
  • mx_collection (dict) – The data collection parameters.

  • bl_config (dict) – The beamline setup.

Returns:

None

storeImage(image_dict)#

Stores the image (image parameters) <image_dict>

Parameters:

image_dict (dict) – A dictionary with image pramaters.

Returns:

None

store_beamline_setup(session_id, bl_config)[source]#

Stores the beamline setup dict <bl_config>.

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

  • bl_config (dict) – The dictionary with beamline settings.

Returns beamline_setup_id:

The database id of the beamline setup.

Return type:

str

store_data_collection(mx_collection, bl_config=None)[source]#

Stores the data collection mx_collection, and the beamline setup if provided.

Parameters:
  • mx_collection (dict) – The data collection parameters.

  • bl_config (dict) – The beamline setup.

Returns:

None

store_image(image_dict)[source]#

Stores the image (image parameters) <image_dict>

Parameters:

image_dict (dict) – A dictionary with image pramaters.

Returns:

None

store_robot_action(robot_action_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 – robot action dictionary as defined above

translate(code, what)[source]#

Given a proposal code, returns the correct code to use in the GUI, or what to send to LDAP, user office database, or the ISPyB database.

updateBLSample(bl_sample)#

Creates or stos a BLSample entry.

Parameters:

sample_dict (dict) – A dictionary with the properties for the entry.

# NBNB update doc string

updateDataCollection(mx_collection, wait=False)#

Updates the datacollction mx_collection, this requires that the collectionId attribute is set and exists in the database.

Parameters:

mx_collection (dict) – The dictionary with collections parameters.

Returns:

None

update_bl_sample(bl_sample)[source]#

Creates or stos a BLSample entry.

Parameters:

sample_dict (dict) – A dictionary with the properties for the entry.

# NBNB update doc string

update_data_collection(mx_collection, wait=False)[source]#

Updates the datacollction mx_collection, this requires that the collectionId attribute is set and exists in the database.

Parameters:

mx_collection (dict) – The dictionary with collections parameters.

Returns:

None