mxcubecore.HardwareObjects.abstract.PyISPyBDataAdapter#
Classes
|
Adapter to convert data from PyISPyB REST API. |
- class mxcubecore.HardwareObjects.abstract.PyISPyBDataAdapter.PyISPyBDataAdapter(client: PyISPyBRestClient, beamline_name: str, new_session_duration_days: int = 2)[source]#
Bases:
objectAdapter to convert data from PyISPyB REST API.
- Parameters:
client (PyISPyBRestClient) –
beamline_name (str) –
new_session_duration_days (int) –
- associate_bl_sample_and_energy_scan(entry_dict: dict) int[source]#
Associates bl sample and energy scan in PyISPyB.
- create_session(proposal: Proposal) Session[source]#
Creates new session via PyISPyB REST API for the given proposal.
- find_detector(manufacturer, model, mode, type='') dict | None[source]#
Finds detector by its type, manufacturer, model and mode.
Gives the first matching detector or None if no match is found. :param manufacturer: The manufacturer of the detector. :param model: The model of the detector. :param mode: The mode of the detector. :param type: The type of the detector (optional).
- Returns:
A dictionary containing detector details.
- Return type:
dict | None
- find_sessions_by_proposal_and_beamline_for_today(code: str, number: str, beamline: str) list[mxcubecore.model.lims_session.Session][source]#
Finds todays sessions by proposal code, number and beamline name.
- Parameters:
- Return type:
- get_data_collection(data_collection_id: int) dict[source]#
Fetches data collection details from PyISPyB.
- get_proposals() list[mxcubecore.model.lims_session.Proposal][source]#
Returns proposals to which authenticated user has access.
- Return type:
- get_samples(proposal_id: int) list[dict][source]#
Fetches samples for the given proposal id from PyISPyB.
- get_sessions_by_code_and_number(code: str, number: str, beamline: str) LimsSessionManager[source]#
Finds a session by its proposal code and number and beamline name.
- Parameters:
- Return type:
- get_sessions_by_username(username: str = '', beamline_name: str = '') LimsSessionManager[source]#
Get the list of sessions for the authenticated user and current beamline.
PyISPyB returns only proposals accessible to the authenticated user. For each proposal, the method fetches sessions for the current month and picks one overlapping with the current time. If no such session exists, a new one is created. :param username: Username to fetch sessions for (left for consistency) :param beamline_name: Beamline name to fetch sessions for (left for consistency)
- Returns:
A manager containing the list of sessions
- Return type:
- Parameters:
- store_beamline_setup(session_id: int, bl_config: dict) int | None[source]#
Stores beamline setup in PyISPyB and associates it with the session.
- store_energy_scan(energyscan: dict) dict[str, int][source]#
Stores energy scan in PyISPyB
- Parameters:
energyscan (dict) – A dictionary containing energy scan information.
- Returns:
number}, where number is the id of the stored energy scan.
- Return type:
Dictionary {“energyScanId”
- store_xfe_spectrum(xfe_spectrum: dict) dict[str, int][source]#
Stores XFE fluorescence spectrum in PyISPyB
- Parameters:
xfe_spectrum (dict) – A dictionary containing XFE fluorescence spectrum information.
- Returns:
number}, where number is the id of the stored XFE fluorescence spectrum.
- Return type:
Dictionary {“xfeFluorescenceSpectrumId”