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: HardwareObject

Web-service client for ISPyB.

Get the LIMS link the data collection with id <id>.

Parameters:

did (str) – Data collection ID

Returns:

The link to the data collection

echo()[source]#

Mockup for the echo method.

find_detector(type, manufacturer, model, mode)[source]#

Returns the Detector3VO object with the characteristics matching the ones given.

getBLSample(bl_sample_id)#

Fetch the BLSample entry with the id bl_sample_id

Parameters:

bl_sample_id (int) –

Returns:

A BLSampleWSValue, defined in the wsdl.

Return type:

BLSampleWSValue

getDataCollection(data_collection_id)#

Retrives the data collection with id <data_collection_id>

Parameters:

data_collection_id (int) – Id of data collection.

Return type:

dict

getProposal(proposal_code, proposal_number)#

Returns the tuple (Proposal, Person, Laboratory, Session, Status). Containing the data from the coresponding 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

getSessionSamples(proposal_id, session_id, sample_refs)#

Retrives the list of samples associated with the session <session_id>. The samples from ISPyB is cross checked with the ones that are currently in the sample changer.

The datamatrix code read by the sample changer is used in case of conflict.

Parameters:
  • proposal_id (int) – ISPyB proposal id.

  • session_id (int) – ISPyB session id to retreive samples for.

  • sample_refs (list (of sample_ref objects).) – The list of samples currently in the sample changer. As a list of sample_ref objects

Returns:

A list with sample_ref objects.

Return type:

list

get_bl_sample(bl_sample_id)[source]#

Fetch the BLSample entry with the id bl_sample_id

Parameters:

bl_sample_id (int) –

Returns:

A BLSampleWSValue, defined in the wsdl.

Return type:

BLSampleWSValue

get_data_collection(data_collection_id)[source]#

Retrives the data collection with id <data_collection_id>

Parameters:

data_collection_id (int) – Id of data collection.

Return type:

dict

get_proposal(proposal_code, proposal_number)[source]#

Returns the tuple (Proposal, Person, Laboratory, Session, Status). Containing the data from the coresponding 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_session_samples(proposal_id, session_id, sample_refs)[source]#

Retrives the list of samples associated with the session <session_id>. The samples from ISPyB is cross checked with the ones that are currently in the sample changer.

The datamatrix code read by the sample changer is used in case of conflict.

Parameters:
  • proposal_id (int) – ISPyB proposal id.

  • session_id (int) – ISPyB session id to retreive samples for.

  • sample_refs (list (of sample_ref objects).) – The list of samples currently in the sample changer. As a list of sample_ref objects

Returns:

A list with sample_ref objects.

Return type:

list

init()[source]#

Init method declared by HardwareObject.

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

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 dictonary 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 dictonary with image pramaters.

Returns:

None

storeXfeSpectrum(xfespectrum_dict)#

Stores a xfe spectrum.

Returns:

A dictionary with the xfe spectrum id.

Return type:

dict

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 dictonary 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_data_collection_group(mx_collection)[source]#

Stores or updates a DataCollectionGroup object. The entry is updated of the group_id in the mx_collection dictionary is set to an exisitng DataCollectionGroup id.

Parameters:

mx_collection (dict) – The dictionary of values to create the object from.

Returns:

DataCollectionGroup id

Return type:

int

store_image(image_dict)[source]#

Stores the image (image parameters) <image_dict>

Parameters:

image_dict (dict) – A dictonary with image pramaters.

Returns:

None

store_robot_action(robot_action_dict)[source]#

Stores robot action

store_xfe_spectrum(xfespectrum_dict)[source]#

Stores a xfe spectrum.

Returns:

A dictionary with the xfe spectrum id.

Return type:

dict

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 dictonary 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 dictonary 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