Source code for scm.input_classes.engines.external

from __future__ import annotations
from pathlib import Path
from typing import Iterable, Literal, Sequence
from scm.pisa.block import DriverBlock,EngineBlock,FixedBlock,FreeBlock,InputBlock
from scm.pisa.key import BoolKey,FloatKey,FloatListKey,IntKey,IntListKey,MultipleChoiceKey,PathStringKey,StringKey,BoolType

[docs]class External(EngineBlock): r""" :ivar Execute: The command to execute to run the external engine. The command is executed in a temporary subdirectory to the results directory. :vartype Execute: str | StringKey :ivar ExecuteAtEnd: The command to execute after the last calculation (e.g. after the final step of a geometry optimization). This can, for example, be used to run a custom analysis tool, or to stop a background process. The command is executed in the results directory. :vartype ExecuteAtEnd: str | StringKey :ivar InputDefinition: The JSON file containing the definition of the input for the external engine. :vartype InputDefinition: str | Path | StringKey :ivar Input: The text input of the engine. This has to match with the JSON input definition set with the InputDefinition keyword. :vartype Input: str | Sequence[str] | FreeBlock :ivar Supports: Specifies the capabilities of the external engine. :vartype Supports: External._Supports """
[docs] class _Input(InputBlock): r""" The text input of the engine. This has to match with the JSON input definition set with the InputDefinition keyword. """ def __post_init__(self): pass
[docs] class _Supports(FixedBlock): r""" Specifies the capabilities of the external engine. :ivar DipoleMoment: Whether the external engine can calculate dipole moments. :vartype DipoleMoment: BoolType | BoolKey :ivar NonSpecificSystems: Whether the engine can handle calculating any system in any order, or if it is restricted to a single system and only supports changes in the geometry. Engines that only handle a specific system can not be used for tasks such as GCMC, MD calculations with insertions (molecule gun), or numerical phonon calculations. :vartype NonSpecificSystems: BoolType | BoolKey :ivar PeriodicityBulk: Whether the external engine supports 3D periodic systems. :vartype PeriodicityBulk: BoolType | BoolKey :ivar PeriodicityChain: Whether the external engine supports 1D periodic systems, i.e. chains. :vartype PeriodicityChain: BoolType | BoolKey :ivar PeriodicityNone: Whether the external engine supports non-periodic systems, i.e. molecules. :vartype PeriodicityNone: BoolType | BoolKey :ivar PeriodicitySlab: Whether the external engine supports 2D periodic systems, i.e. slabs. :vartype PeriodicitySlab: BoolType | BoolKey """ def __post_init__(self): self.DipoleMoment: BoolType | BoolKey = BoolKey(name='DipoleMoment', comment='Whether the external engine can calculate dipole moments.', default=True) self.NonSpecificSystems: BoolType | BoolKey = BoolKey(name='NonSpecificSystems', comment='Whether the engine can handle calculating any system in any order, or if it is restricted to a single system and only supports changes in the geometry. Engines that only handle a specific system can not be used for tasks such as GCMC, MD calculations with insertions (molecule gun), or numerical phonon calculations.', default=True) self.PeriodicityBulk: BoolType | BoolKey = BoolKey(name='PeriodicityBulk', comment='Whether the external engine supports 3D periodic systems.', default=True) self.PeriodicityChain: BoolType | BoolKey = BoolKey(name='PeriodicityChain', comment='Whether the external engine supports 1D periodic systems, i.e. chains.', default=True) self.PeriodicityNone: BoolType | BoolKey = BoolKey(name='PeriodicityNone', comment='Whether the external engine supports non-periodic systems, i.e. molecules.', default=True) self.PeriodicitySlab: BoolType | BoolKey = BoolKey(name='PeriodicitySlab', comment='Whether the external engine supports 2D periodic systems, i.e. slabs.', default=True)
def __post_init__(self): self.Execute: str | StringKey = StringKey(name='Execute', comment='The command to execute to run the external engine. The command is executed in a temporary subdirectory to the results directory.') self.ExecuteAtEnd: str | StringKey = StringKey(name='ExecuteAtEnd', comment='The command to execute after the last calculation (e.g. after the final step of a geometry optimization). This can, for example, be used to run a custom analysis tool, or to stop a background process. The command is executed in the results directory.') self.InputDefinition: str | Path | StringKey = PathStringKey(name='InputDefinition', comment='The JSON file containing the definition of the input for the external engine.', ispath=True) self.Input: str | Sequence[str] | FreeBlock = self._Input(name='Input', comment='The text input of the engine. This has to match with the JSON input definition set with the InputDefinition keyword.', header=True) self.Supports: External._Supports = self._Supports(name='Supports', comment='Specifies the capabilities of the external engine.')