mxcubecore.HardwareObjects.Session#
Session hardware object.
Contains information regarding the current session and methods to access and manipulate this information.
Classes
|
- class mxcubecore.HardwareObjects.Session.Session(name)[source]#
Bases:
HardwareObject
- get_base_data_directory()[source]#
Returns the base data directory taking the ‘contextual’ information into account, such as if the current user is inhouse.
- Returns:
The base data path.
- Return type:
- get_default_prefix(sample_data_node=None, generic_name=False)[source]#
Returns the default prefix, using sample data such as the acronym as parts in the prefix.
- get_default_subdir(sample_data: dict) str [source]#
Gets the default sub-directory based on sample information
- get_full_path(subdir: str = '', tag: str = '') Tuple[str, str] [source]#
Returns the full path to both image and processed data. The path(s) returned will follow the convention:
<base_directory>/<subdir>/run_<NUMBER>_<tag>
Where NUMBER is a automatically sequential number and base_directory the path returned by get_base_image/process_directory
- get_inhouse_user()[source]#
- Returns:
The current inhouse user.
- Return type:
tuple (<proposal_code>, <proposal_number>)
- get_path_with_proposal_as_root(path: str) str [source]#
Strips the beginning of the path so that it starts with the proposal folder as root
- get_proposal()[source]#
- Returns:
The proposal, ‘local-user’ if no proposal is available
- Return type:
- init()[source]#
‘public’ post-initialization method. Override as needed.
For ConfiguredObjects called after loading contained objects.
- is_inhouse(proposal_code=None, proposal_number=None)[source]#
Determines if a given proposal is considered to be inhouse.
- prepare_directories(_session)[source]#
Prepares directories required for the given session.
This method is a placeholder intended to be overridden in subclasses to implement logic for creating or preparing directories. By default, the method is empty and does not perform any actions nor raise errors, since its implementation may be skipped in some cases.
- Parameters:
_session – The session object containing session-specific information.