nexusLIMS.instruments#
Methods and representations for instruments in a NexusLIMS system.
- ivar instrument_db:
A dictionary of
Instrumentobjects.Each object in this dictionary represents an instrument detected in the NexusLIMS remote database.
- vartype instrument_db:
dict
Module Contents#
Functions#
Get an instrument object by a given path Using the NexusLIMS database. |
|
Get an instrument object from the NexusLIMS database by its calendar name. |
|
Get an instrument object from the NexusLIMS database by its |
Data#
API#
- nexusLIMS.instruments.instrument_db#
Type: dict
- nexusLIMS.instruments.get_instr_from_filepath(path: Path) Instrument | None[source]#
Get an instrument object by a given path Using the NexusLIMS database.
- Parameters:
path – A path (relative or absolute) to a file saved in the central filestore that will be used to search for a matching instrument
- Returns:
instrument – An
Instrumentinstance matching the path, or None if no match was found- Return type:
Instrument or None
Examples:
>>> inst = get_instr_from_filepath('/path/to/file.dm3') >>> str(inst) 'FEI-Titan-TEM-012345 in Bldg 1/Room A'
- nexusLIMS.instruments.get_instr_from_calendar_name(cal_name)[source]#
Get an instrument object from the NexusLIMS database by its calendar name.
- Parameters:
cal_name (str) – A calendar name (e.g. “FEITitanTEMEvents”) that will be used to search for a matching instrument in the
api_urlvalues- Returns:
instrument – An
Instrumentinstance matching the path, or None if no match was found- Return type:
Instrument or None
Examples:
>>> inst = get_instr_from_calendar_name('FEITitanTEMEvents') >>> str(inst) 'FEI-Titan-TEM-012345 in Bldg 1/Room A'
- nexusLIMS.instruments.get_instr_from_api_url(api_url: str) Instrument | None[source]#
Get an instrument object from the NexusLIMS database by its
api_url.- Parameters:
api_url – An api_url (e.g. “FEITitanTEMEvents”) that will be used to search for a matching instrument in the
api_urlvalues- Returns:
An
Instrumentinstance matching theapi_url, orNoneif no match was found- Return type:
Examples:
>>> inst = get_instr_from_api_url('https://nemo.example.com/api/tools/?id=1') >>> str(inst) 'FEI-Titan-STEM-012345 in Bldg 1/Room A'