pqanalysis_input_file_reader¶
A module for reading the input file for the PQAnalysis.
Summary¶
Classes:
A class to read the input file for the PQAnalysis. |
Reference¶
- class PQAnalysisInputFileReader(filename: str)[source]¶
Bases:
_FileMixin,_SelectionMixin,_PositionsMixinA class to read the input file for the PQAnalysis. It inherits from _FileMixin, _SelectionMixin and _PositionsMixin.
The main idea of this class is work as a super class for all command line tools of PQAnalysis, but it can also be used as a standalone class. But if for example an analysis tool needs only few input file keywords, it is recommended to inherit from this class.
Attention
As this class is not intended to be used as a standalone class, it does not check if all required keys are set in the input file, thus also no information/documentation of the values of the keywords is given, so that they can be used accordingly in the implementing subclasses.
Sets the format to InputFileFormat.PQANALYSIS, remembers the filename and its directory, and creates an InputFileParser that expands glob values in that directory.
- Parameters:
filename (str) – the filename of the input file
- check_known_keys(
- known_keys: list[str] | None = None,
Checks if all keys in the input file are known.
- Parameters:
known_keys (List[str] | None, optional) – the known keys, by default None
- Warns:
InputFileWarning – if unknown keys were set in the input file
- check_required_keys(
- required_keys: list[str],
Checks if all required keys are set in the input file.
- Parameters:
required_keys (List[str]) – the required keys
- Raises:
InputFileError – if not all required keys are set in the input file
- not_defined_optional_keys(
- optional_keys: list[str],
Checks if optional keys are set in the input file. If not set, it sets them to None.
- Parameters:
optional_keys (List[str]) – the optional keys
- read()[source]¶
Reads the input file and parses it. It also sets the raw_input_file and the dictionary.
- resolve_path(
- path: str | None,
Resolves a filename from the input file against the directory of the input file.
Relative filenames in an input file refer to the directory that contains the input file, not to the working directory of the process. Absolute filenames are returned unchanged.
- Parameters:
path (str | None) – the filename as written in the input file
- Returns:
the resolved filename, or None if path is None
- Return type:
str | None
- resolve_paths(
- paths: list[str] | None,
Resolves a list of filenames with
resolve_path().- Parameters:
paths (List[str] | None) – the filenames as written in the input file
- Returns:
the resolved filenames, or None if paths is None
- Return type:
List[str] | None
- property delta_r: PositiveReal | None¶
The radius step size of the PQAnalysis.
- Type:
PositiveReal | None
- delta_r_key = 'delta_r'¶
- known_keys = ['r_max', 'r_min', 'delta_r', 'n_bins', 'traj_files', 'selection', 'reference_selection', 'target_selection', 'use_full_atom_info', 'out_file', 'log_file', 'no_intra_molecular', 'moldescriptor_file', 'restart_file']¶
- property log_file: str | None¶
The log file of the simulation.
- Type:
str | None
- log_file_key = 'log_file'¶
- logger = <CustomLogger PQAnalysis.PQAnalysisInputFileReader (INFO)>¶
- property moldescriptor_file: str | None¶
The moldescriptor file of the simulation.
- Type:
str | None
- moldescriptor_file_key = 'moldescriptor_file'¶
- property n_bins: PositiveInt | None¶
The number of bins of the PQAnalysis.
- Type:
PositiveInt | None
- n_bins_key = 'n_bins'¶
- property no_intra_molecular: bool | None¶
Whether intra molecular interactions should be excluded.
- Type:
bool | None
- no_intra_molecular_key = 'no_intra_molecular'¶
- property out_file: str | None¶
The out file of the simulation.
- Type:
str | None
- out_file_key = 'out_file'¶
- property r_max: PositiveReal | None¶
The maximum radius of the PQAnalysis.
- Type:
PositiveReal | None
- r_max_key = 'r_max'¶
- property r_min: PositiveReal | None¶
The minimum radius of the PQAnalysis.
- Type:
PositiveReal | None
- r_min_key = 'r_min'¶
- property reference_selection: str | None¶
The reference selection of the simulation.
- Type:
str | None
- reference_selection_key = 'reference_selection'¶
- property restart_file: str | None¶
The restart file of the simulation.
- Type:
str | None
- restart_file_key = 'restart_file'¶
- property selection: str | None¶
The selection of the simulation.
- Type:
str | None
- selection_key = 'selection'¶
- property target_selection: str | None¶
The target selection of the simulation.
- Type:
str | None
- target_selection_key = 'target_selection'¶
- property traj_files: list[str] | None¶
The trajectory files of the simulation.
- Type:
List[str] | None
- traj_files_key = 'traj_files'¶
- property use_full_atom_info: bool | None¶
Whether the full atom information should be used.
- Type:
bool | None
- use_full_atom_info_key = 'use_full_atom_info'¶