autojob.coordinator package¶
Coordinate the creation of study groups.
This subpackage provides utilities for the creation of study groups.
The autojob.coordinator module is especially useful for parametrizing
calculations en masse. The Coordinator GUI can be launched
programmatically with the gui.run() function
from autojob.coordinator.gui import gui
gui.run()
or from the command line with the autojob coordinator CLI command
autojob coordinator
Subpackages¶
- autojob.coordinator.gui package
- Submodules
- autojob.coordinator.gui.groups module
- autojob.coordinator.gui.gui module
- autojob.coordinator.gui.job_submission module
AutoRestartPanelExtrasPanelGroupSelectionComboboxJobSubmissionPanelsJobSubmissionParametersJobSubmissionTabJobSubmissionTab.create_panels()JobSubmissionTab.initialize_submission_parameters()JobSubmissionTab.load()JobSubmissionTab.new_submission_parameters()JobSubmissionTab.pack_panels()JobSubmissionTab.partition_enforcement()JobSubmissionTab.remove_panels()JobSubmissionTab.submission_parametersJobSubmissionTab.update_panels()JobSubmissionTab.update_parameters()
MemoryPanelParallelizationPanelPartitionPanelPartitionPanel.add_partitions()PartitionPanel.clear_partitions()PartitionPanel.create_button_frame()PartitionPanel.create_combobox()PartitionPanel.create_listbox()PartitionPanel.enforce_partition_limits()PartitionPanel.format_partitions()PartitionPanel.load()PartitionPanel.load_partitions()PartitionPanel.organize()PartitionPanel.remove_partitions()
RunTimeDictRunTimePanel
- autojob.coordinator.gui.parameter_selection module
GroupSelectionComboboxParameterInputFrameParameterInputSectionParameterPanelParameterPanel.add_parameter_values()ParameterPanel.clear_parameter_values()ParameterPanel.configure_rbs()ParameterPanel.create_button_frame()ParameterPanel.create_default_button()ParameterPanel.load()ParameterPanel.organize()ParameterPanel.remove_parameter_values()ParameterPanel.set_parameter_entry_method()ParameterPanel.set_states()ParameterPanel.use_default()
ParameterRadiobuttonFrameParameterSelectionComboboxParameterSelectionTab
- autojob.coordinator.gui.structure_selection module
GroupButtonFrameGroupButtonFrame.add_structures_to_group()GroupButtonFrame.create_add_to_group()GroupButtonFrame.create_create_group()GroupButtonFrame.create_del_group()GroupButtonFrame.create_group()GroupButtonFrame.del_group()GroupButtonFrame.load()GroupButtonFrame.organize()GroupButtonFrame.reset_cbs()GroupButtonFrame.structure_groups
GroupViewFrameStructureSelectionFrameStructureSelectionPanelStructureSelectionTab
- autojob.coordinator.gui.study_configuration module
- autojob.coordinator.gui.submission_configuration module
AddToGroupFrameButtonFrameGroupButtonFrameGroupButtonFrame.create_create_group()GroupButtonFrame.create_del_group()GroupButtonFrame.create_group()GroupButtonFrame.create_view_group()GroupButtonFrame.del_group()GroupButtonFrame.load()GroupButtonFrame.organize()GroupButtonFrame.submission_parameter_groupsGroupButtonFrame.update_groups()GroupButtonFrame.view_groups()
GroupSummarySelectionFrameSelectionPanelSpecButtonStructureSelectionPanelSubmissionConfigurationTabValueSelectionPanelViewFrame
- autojob.coordinator.gui.summary module
- autojob.coordinator.gui.widgets module
Submodules¶
autojob.coordinator.classification module¶
DEPRECATED: metaclasses are not needed, CalculatorType and StudyType.
are in calculation and study, respectively. CalculationTypes should be implemented as class-level constants in calculation (or separate modules) as subclasses of Calculation.
- class autojob.coordinator.classification.ABCEnumMeta(*args, **kw)[source]¶
-
A metaclass for abstract base classes for enums.
Create enum with abstract methods.
- Raises:
TypeError – Missing abstract methods.
- Returns:
The created class instance.
- class autojob.coordinator.classification.CalculationType(value)[source]¶
Bases:
ImplementableEnumA type of calculation.
- DOS = 'density of states'¶
- EOS = 'equation of state'¶
- MD = 'molecular dynamics'¶
- RELAXATION = 'relaxation'¶
- VIB = 'vibrational analysis'¶
- class autojob.coordinator.classification.CalculatorType(value)[source]¶
Bases:
ImplementableEnumTypes of calculators.
- ABINIT = 'abinit'¶
- AIMS = 'aims'¶
- AMBER = 'amber'¶
- ASAP = 'asap'¶
- CASTEP = 'castep'¶
- CP2K = 'cp2k'¶
- CRYSTAL = 'crystal'¶
- DEMON = 'demon'¶
- DEMON_NANO = 'demonnano'¶
- DFTB = 'dftb'¶
- DFTD3 = 'dftd3'¶
- DMOL3 = 'dmol'¶
- EAM = 'eam'¶
- ELK = 'elk'¶
- EMT = 'emt'¶
- ESPRESSO = 'espresso'¶
- EXCITING = 'exciting'¶
- FLEUR = 'fleur'¶
- FORCE_FIELD = 'ff'¶
- GAMESS_US = 'gamess_us'¶
- GAUSSIAN = 'gaussian'¶
- GPAW = 'gpaw'¶
- GROMACS = 'gromacs'¶
- GULP = 'gulp'¶
- HOTBIT = 'hotbit'¶
- KIM = 'kim'¶
- LAMMPS = 'lammpsrun'¶
- LAMMPS_LIB = 'lammpslib'¶
- LENNARD_JONES = 'lj'¶
- MOPAC = 'mopac'¶
- MORSE_POTENTIAL = 'morse'¶
- NWCHEM = 'nwchem'¶
- OCTOPUS = 'octopus'¶
- ONETEP = 'onetep'¶
- OPENMX = 'openmx'¶
- ORCA = 'orca'¶
- PSI4 = 'psi4'¶
- QCHEM = 'qchem'¶
- SIESTA = 'siesta'¶
- TIP3P = 'tip3p'¶
- TIP4P = 'tip4p'¶
- TURBOMOLE = 'turbomole'¶
- VASP = 'vasp'¶
- class autojob.coordinator.classification.ImplementableEnum(value)[source]¶
Bases:
EnumAn Enum that can be implemented.
autojob.coordinator.cli module¶
Define the CLI function for the Coordinator GUI.
autojob.coordinator.coordinator module¶
Coordinate the creation and submission of jobs.
The Coordinator class stores references to the calculator
and submission parameter groups used and can generate and submit jobs
created from these parameter groups.
- class autojob.coordinator.coordinator.Coordinator(app: GUI, dest: Path | None = None)[source]¶
Bases:
objectCreate and submit jobs from parameter groups.
- Variables:
app – The running
gui.GUIinstance.submit_dir – The directory in which new study groups will be created.
slurm_scripts – A list of paths to slurm scripts.
study_uuids – A list of UUIDs of the studies in the study groups.
compute_canada_format – Whether or not the slurm scripts are to be created in ComputeCanada format.
Initialize a Coordinator.
- Parameters:
app – The running
gui.GUIinstance.dest – The directory in which new study groups will be created. Defaults to the current working directory.
- property adsorbates: dict[str, list[str]]¶
A dictionary mapping structure group names to adsorbate lists.
- property adsorption_groups: dict[str, list[dict[str, list]]]¶
A dictionary mapping structure group names to adsorption groups.
- property ase_calculator: Calculator¶
The ASE calculator corresponding to the calculator type.
- calc_param_from(param_name: str, cp_groups: list[str] | None = None) job.CalculationParameter[source]¶
Returns the parameter associated with the name and structure group.
- Parameters:
param_name – Name of the
jobCalculationParameterto be found.cp_groups – A list of names of structure groups to search. Defaults to a list of all structure groups.
- Returns:
The
job.CalculationParametermatchingparam_name. Ifcp_groupsis given, this method finds the firstjob.CalculationParameterdefined in a structure group namedcp_groupswith the name attribute matchingparam_name. Otherwise, this method finds the firstjob.CalculationParameterwith name attribute matchingparam_name.- Raises:
ValueError – No
job.CalculationParameterfound matchingparam_name.
- calc_param_values_for(structures: list[Path], params: list[job.CalculationParameter]) dict[str, list[float | int | str]][source]¶
Finds values corresponding to provided structures and parameters.
- Parameters:
structures – Structure for which the calculation parameters are to obtained.
params – Parameter whose values are to be obtained.
- Returns:
A dictionary mapping calculator parameter names to a list of its values for provided structures. Each value in each list of values corresponds to at least one structure in
structures.
Note
Not all values will be applicable for all selected structures as the function aggregates all potential values for all selected structures.
- property calc_params: dict[str, CalculationParameterGroup]¶
A mapping from names to calculator parameter groups.
- calc_params_for(structures: list[Path]) list[str][source]¶
Finds calculation parameters corresponding to provided structures.
- Parameters:
structures – A list of structures whose parameters are to be found.
- Returns:
The names of all CalculationParameters applicable to at least one structure in
structures.
- property complexes: dict[str, dict[str, dict[str, str]]]¶
A dictionary mapping structure group names to nested dictionaries.
Each nested dictionary maps structure names to a maps between adsorbate names and adsorbate-complex structure files.
Example
group_name = “group 1” structure = “structure 1” adsorbate = “adsorbate 1” complexes = coordinator.complexes group = complexes[group_name]
# A map from adsorbate names to adsorbate complex filenames adsorbate_to_structure_complex = group[structure]
# The filename for an adsorbate complex complex_structure = adsorbate_to_structure_complex[adsorbate]
- create_structure_tasks(atoms: Atoms, calculation_parameter_sets: list[dict[str, Any]], metadata: dict[str, Any], legacy_mode: bool = True) list[TaskBase][source]¶
Create all tasks corresponding to a given structure.
- Parameters:
atoms – The
Atomsobjectcalculation_parameter_sets – A list of dictionaries where each dictionary maps parameter names to their value.
metadata – Study metadata to be shared with each created TaskBase.
legacy_mode – Whether or not to create legacy mode-compatible TaskBases.
- Returns:
A list of
TaskBaseobjects.
- create_study_group(*, legacy_mode: bool = True) StudyGroup[source]¶
Create a study group from the Coordinator GUI.
- Parameters:
legacy_mode – Whether or not to use the legacy directory structure when creating task directories. Defaults to True.
- Returns:
The created
StudyGroup.
- create_tasks(*, legacy_mode: bool = True) Path[source]¶
Create the task directories of a study group.
- Parameters:
legacy_mode – Whether or not to use legacy mode. Defaults to True.
- property jobs: list[dict[str, str | CalculatorType | dict[str, dict[str, Any]]]]¶
A list of jobs.
Each job is represented as a mapping from parameters to their values.
- property sensitivity_jobs: list[dict[str, str | CalculatorType | dict[str, dict[str, Any]]]]¶
A list of sensitivity jobs.
- property structure_groups: dict[str, StructureGroup]¶
A dictionary mapping structure group names to structure groups.
- structure_groups_with(structures: Iterable[Path]) list[str][source]¶
Retrieve all structure groups containing structures.
- Parameters:
structures – A list of structures to be found in
Coordinator.structure_groups.- Returns:
The list of structure groups containing at least one of the selected structures.
- property structures_without_calc_params: list[str]¶
A list of structure filenames without calculation parameters.
- property structures_without_subm_params: list[dict]¶
A list of structure filenames without submission parameters.
- property studies: dict[str, list[dict[str, str | CalculatorType | dict[str, dict[str, Any]]]]]¶
A dictionary mapping study names to all jobs within that study.
- property subm_params: dict[str, dict[str, dict | float | int | tuple | str]]¶
A mapping from names to submission parameters.
- subm_params_for(structure: Path, calc_params: dict[job.CalculationParameter, str]) dict[str, dict | int | list | None][source]¶
Finds submission parameters for a given structure and parameters.
- Parameters:
structure – The structure for the calculation.
calc_params – The structure-specific parameters for the calculation.
- Returns:
The submission parameters for the calculation.
Note
If the calculation satisfies the conditions set forth by multiple parameter groups, the function returns the submission parameters corresponding to the alphanumeric first.
- property submission_parameter_groups: dict[str, SubmissionParameterGroup]¶
A mapping from names to submission parameter groups.
- autojob.coordinator.coordinator.submission_parameters_to_scheduler_inputs(parameters: JobSubmissionParameters) SchedulerInputs[source]¶
Convert submission parameters to
SchedulerInputs.- Parameters:
parameters – A submission parameter dictionary.
- Returns:
A
SchedulerInputsinstance.
autojob.coordinator.espresso module¶
Define Gaussian calculation parameters.
- class autojob.coordinator.espresso.EspressoJob(job_id: str, calculation_id: str, study_id: str, study_group_id: str, input_parameters: dict, results: dict, job_stats: dict[str, str | int] | None, calculator_type: CalculatorType | None = None, calculation_type: CalculationType | None = None, study_type: StudyType | None = None, error: JobError | None = None, name: str = '', notes: str = '')[source]¶
Bases:
JobA class to represent a Espresso job.
Initialize a
Job.- Parameters:
job_id – The job ID.
calculation_id – The calculation ID.
study_id – The study ID.
study_group_id – The study group ID.
input_parameters – The input parameters for the job.
results – The job results.
job_stats – The job statistics.
calculator_type – The calculator type. Defaults to None.
calculation_type – The calculation type. Defaults to None.
study_type – The study type. Defaults to None.
error – The job error. Defaults to None.
name – The job name. Defaults to “”.
notes – Notes on the job. Defaults to “”.
- static input_parameters() list[CalculationParameter][source]¶
Generate Gaussian job input parameters.
autojob.coordinator.filters module¶
Utilities for filtering parameter dictionaries by their values.
Example
>>> from autojob.coordinator.filters import Filter
>>> from autojob.parametrizations import VariableReference
>>> flt = Filter(
... source=VariableReference(set_path=[], get_path=("inputs", "filename")),
... values=("a", "b"),
... )
>>> value1 = {"inputs": {"filename": "A"}}
>>> value2 = {"inputs": {"filename": "b"}}
>>> flt.apply(value1)
False
>>> flt.apply(value2)
True
- class autojob.coordinator.filters.Filter(source: VariableReference, values: tuple[Any])[source]¶
Bases:
NamedTupleA condition that must be satisfied.
- Variables:
source (autojob.parametrizations.VariableReference) – A
VariableReferenceindicating which input variable to reference for the comparison.values (tuple[Any]) – The allowed values for the variable.
Create new instance of Filter(source, values)
- apply(value: dict[str, Any] | object) bool[source]¶
Determine if the value passes the filter.
- Parameters:
value – The value to which the filter will be applied.
- Returns:
True if the value passes the filter. False otherwise.
- source: VariableReference¶
Alias for field number 0
autojob.coordinator.gaussian module¶
Define Gaussian calculation parameters.
- class autojob.coordinator.gaussian.GaussianJob(job_id: str, calculation_id: str, study_id: str, study_group_id: str, input_parameters: dict, results: dict, job_stats: dict[str, str | int] | None, calculator_type: CalculatorType | None = None, calculation_type: CalculationType | None = None, study_type: StudyType | None = None, error: JobError | None = None, name: str = '', notes: str = '')[source]¶
Bases:
JobA class to represent a Gaussian job.
Initialize a
Job.- Parameters:
job_id – The job ID.
calculation_id – The calculation ID.
study_id – The study ID.
study_group_id – The study group ID.
input_parameters – The input parameters for the job.
results – The job results.
job_stats – The job statistics.
calculator_type – The calculator type. Defaults to None.
calculation_type – The calculation type. Defaults to None.
study_type – The study type. Defaults to None.
error – The job error. Defaults to None.
name – The job name. Defaults to “”.
notes – Notes on the job. Defaults to “”.
- static input_parameters() list[CalculationParameter][source]¶
Generate Gaussian job input parameters.
autojob.coordinator.job module¶
This module defines the Job class and the JobError enum.
Deprecated since version Use: autojob.task, autojob.calculation,
autojob.hpc instead.
- class autojob.coordinator.job.CalculationParameter(name: str, explicit: bool, allowed_types: list[type], values: tuple, default: float | int | str | None = None, description: str | None = None, specials: list | None = None)[source]¶
Bases:
objectAbstraction of an input parameter for a supported ASE calculator.
- Variables:
_name – The name of the InputParameter.
_explicit – Whether the set of allowed values for the InputParameter is explicitly specified. True if the set of allowed values for the input parameter is explicitly specified; False otherwise.
_allowed_types – The allowed types for the InputParameter. For
displaying (validation and)
string (there exists special values for the InputParameter (e.g.,)
types (values that correspond to particular values), the allowed)
values. (should not be designated so as to include these special)
integer (For example, say that a particular InputParameter accepts)
particular (values, but that the string 'normal' corresponds to a)
specified (value. The allowed types for the InputParameter should be)
'_allowed_types'. (Only primitive types are allowed as entries in)
float (That is, the entries must be one of str, int, bool, or) – _allowed_types = [int] <— allowed _allowed_types = [int, str] <— allowed _allowed_types = [Union[int, str]] <— not allowed _allowed_types = [list, str] <— not allowed _allowed_types = [List, str] <— not allowed _allowed_types = [List[int], str] <— not allowed _allowed_types = [Tuple[int, int, int]] <— not allowed _allowed_types = [List[List[int]]] <— not allowed
_values –
Indicates the allowed values of an InputParameter.
If the allowed values are explicitly specified, then the tuple contains the only allowed values.
If the allowed values are specified as a range, then the tuple should contain three entries.
The first and second items in the tuple indicate the lower and upper bounds of the range, respectively, which should be set to -math.inf and math.inf to specify that the range is unbounded with respect to the bound.
The third item should be a string, indicating how to treat the endpoints of the range in the same style as traditional mathematical notation:
”[]” = both bounds included “[)” = lower bound included, upper bound excluded “(]” = lower bound excluded, upper bound included “()” = both bounds excluded
_specials – Indicates any special, allowed parameter values that
tuple. (may not satisfy the conditions specified in the '_values')
list. (Defaults to an empty)
_default – A default value for the InputParameter.
_description – Returns a description of the InputParameter to be
tooltips. (used for displaying)
Initialize a
CalculationParameter.- Parameters:
name – The name of the
CalculationParameter.explicit – Whether the set of allowed values for the InputParameter is explicitly specified. True if the set of allowed values for the input parameter is explicitly specified; False otherwise.
allowed_types – An iterable containing the allowed parameter types.
values – A tuple either containing the explicit values or a 3-tuple indicating the bounds of the parameter.
default – The default value of the parameter. Defaults to None.
description – A description of the parameter. Defaults to None.
specials – Special values of the parameter that are not subject to validation. Defaults to None.
- property name¶
The name of the CalculationParameter.
- class autojob.coordinator.job.Job(job_id: str, calculation_id: str, study_id: str, study_group_id: str, input_parameters: dict, results: dict, job_stats: dict[str, str | int] | None, calculator_type: CalculatorType | None = None, calculation_type: CalculationType | None = None, study_type: StudyType | None = None, error: JobError | None = None, name: str = '', notes: str = '')[source]¶
Bases:
ABC,MSONableA SLURM job.
Subclasses must implement the abstract method
input_parameters()- Variables:
_id – Job ID
_input_structure – Input structure for job run.
_output_structure – Output structure from job run.
_submission_params – Parameters for the submission of the job to the
scheduler. (job)
_stats – Statistics from the job run.
_error – Error incurred during job run.
_note – Additional note for job.
Initialize a
Job.- Parameters:
job_id – The job ID.
calculation_id – The calculation ID.
study_id – The study ID.
study_group_id – The study group ID.
input_parameters – The input parameters for the job.
results – The job results.
job_stats – The job statistics.
calculator_type – The calculator type. Defaults to None.
calculation_type – The calculation type. Defaults to None.
study_type – The study type. Defaults to None.
error – The job error. Defaults to None.
name – The job name. Defaults to “”.
notes – Notes on the job. Defaults to “”.
- abstractmethod classmethod from_dict(d: dict) Job[source]¶
Create a
Jobinstance from a dictionary.Job.as_dict()andJob.from_dict()should be designed such that “round-trips” as supported. That is, given an instance ofJob,job, the following is True:job == Job.from_dict(job.as_dict())
- abstractmethod static input_parameters() list[CalculationParameter][source]¶
Returns the input parameters for the type of job.
Subclasses should implement this method.
- class autojob.coordinator.job.JobError(value)[source]¶
Bases:
EnumA job error.
- MEMORY_LIMIT = 'memory limit'¶
- TIME_LIMIT = 'time limit'¶
- class autojob.coordinator.job.JobStats(src_dict: dict[str, str])[source]¶
Bases:
MSONableJob statistics.
- Variables:
memory – The memory used for the job in kilobytes.
start_time – The
datetimeinstance representing the time that the job started.end_time – The
datetimeinstance representing the time that the job ended.submit_time – The
datetimeinstance representing the time that the job was submitted.cores – The number of cores that the job ran on.
nodes – The number of nodes that the job ran on.
partition – A
Partitioninstance representing the cluster partition that the job ran on.
Initialize a
JobStatsinstance.- Parameters:
src_dict – A dictionary mapping
sacctheaders to their values for a SLURM job. The dictionary should have the keys listed injob.JOB_STATS_FIELDS.
- classmethod from_dict(d: dict) JobStats[source]¶
Create a
JobStatsinstance from a dictionary.JobStats.as_dict()andJobStats.from_dict()are designed such that “round-trips” as supported. That is, given an instance ofJobStats,job_stats, the following is True:job_stats == JobStats.from_dict(job_stats.as_dict())
autojob.coordinator.parameters module¶
Define calculator parameters.
- class autojob.coordinator.parameters.CalculatorParameter(name: str = '', allowed_types: tuple[type] = (typing.Any,), special_values: Iterable | None = None, default: Any = None, description: str = '')[source]¶
Bases:
MSONableAbstraction of an calculator parameter for a supported ASE calculator.
- Variables:
name (str; defaults to '') – The name of the CalculatorParameter.
allowed_types (Iterable[Type]; defaults to (Any,)) – The allowed types for the CalculatorParameter. For validation and displaying (in the GUI application) purposes, if there exists special values for the CalculatorParameter (e.g., string values that correspond to particular values), the allowed types should not be designated so as to include these special values.
integer (For example, say that a particular CalculatorParameter accepts)
particular (values, but that the string 'normal' corresponds to a)
be (value. The allowed types for the CalculatorParameter should)
as (specified)
special_values (Iterable; defaults to tuple()) – A tuple indicating the
whose (special values of a CalculatorParameter. These may be values)
attribute (types do not conform to the types specified in the)
'allowed_types'.
_default (Any; defaults to None) – A default value for the
CalculatorParameter.
description (str; defaults to '') – Returns a description of the
tooltips. (CalculatorParameter to be used for displaying)
Initialize a CalculatorParameter.
- Parameters:
name – The name of the CalculatorParameter. Defaults to “”.
allowed_types – An iterable of the allowed types for the parameter. Defaults to (Any,).
special_values – An iterable of the special values for the parameter. Defaults to None.
default – The default value for the parameter. Defaults to None.
description – A description of the parameter. Defaults to “”.
- class autojob.coordinator.parameters.CalculatorType(value)[source]¶
Bases:
EnumA type of ASE calculator.
- ABINIT = 'abinit'¶
- ACE = 'ace'¶
- AIMS = 'aims'¶
- AMBER = 'amber'¶
- ASAP = 'asap'¶
- CASTEP = 'castep'¶
- CP2K = 'cp2k'¶
- CRYSTAL = 'crystal'¶
- DEFAULT = 'vasp'¶
- DEMON = 'demon'¶
- DEMON_NANO = 'demonnano'¶
- DFTB = 'dftb'¶
- DFTD3 = 'dftd3'¶
- DMOL3 = 'dmol'¶
- EAM = 'eam'¶
- ELK = 'elk'¶
- EMT = 'emt'¶
- ESPRESSO = 'espresso'¶
- EXCITING = 'exciting'¶
- FLEUR = 'fleur'¶
- FORCE_FIELD = 'ff'¶
- GAMESS_US = 'gamess_us'¶
- GAUSSIAN = 'gaussian'¶
- GPAW = 'gpaw'¶
- GROMACS = 'gromacs'¶
- GULP = 'gulp'¶
- HOTBIT = 'hotbit'¶
- KIM = 'kim'¶
- LAMMPS = 'lammpsrun'¶
- LAMMPS_LIB = 'lammpslib'¶
- LENNARD_JONES = 'lj'¶
- MOPAC = 'mopac'¶
- MORSE_POTENTIAL = 'morse'¶
- NWCHEM = 'nwchem'¶
- OCTOPUS = 'octopus'¶
- ONETEP = 'onetep'¶
- OPENMX = 'openmx'¶
- ORCA = 'orca'¶
- PSI4 = 'psi4'¶
- QCHEM = 'qchem'¶
- SIESTA = 'siesta'¶
- TIP3P = 'tip3p'¶
- TIP4P = 'tip4p'¶
- TURBOMOLE = 'turbomole'¶
- VASP = 'vasp'¶
- class autojob.coordinator.parameters.MappingParameter(*, member_types: Iterable[type], name: str = '', special_values: Iterable | None = None, default: Any = None, description: str = '')[source]¶
Bases:
CalculatorParameterA parameter that can be a mapping.
Initialize a MappingParameter.
- Parameters:
name – The name of the MappingParameter. Defaults to “”.
member_types – The allowed types of the items in the sequence.
special_values – An iterable of the special values for the parameter. Defaults to None.
default – The default value for the parameter. Defaults to None.
description – A description of the parameter. Defaults to “”.
- classmethod from_dict(d) MappingParameter[source]¶
Initiate a MappingParameter from a dictionary.
- class autojob.coordinator.parameters.NumberMappingParameter(*, name: str = '', allow_floats: bool = False, special_values: Iterable | None = None, default: Any = None, description: str = '', number_range: NumberRange = None)[source]¶
Bases:
MappingParameterA parameter that can be a mapping to numbers.
Initialize a NumberMappingParameter.
- Parameters:
name – The name of the NumberMappingParameter. Defaults to “”.
allow_floats – Whether to allow floats. Defaults to False.
special_values – An iterable of the special values for the parameter. Defaults to None.
default – The default value for the parameter. Defaults to None.
description – A description of the parameter. Defaults to “”.
number_range – A NumberRange to use to limit the parameter. Defaults to None.
- classmethod from_dict(d) NumberMappingParameter[source]¶
Initiate a NumberMappingParameter from a dictionary.
- class autojob.coordinator.parameters.NumberParameter(*, name: str = '', allow_floats: bool = False, special_values: Iterable[type] | None = None, default: Any = None, description: str = '', number_range: NumberRange = None)[source]¶
Bases:
CalculatorParameterA parameter that can be a number.
Initialize a NumberParameter.
- Parameters:
name – The name of the NumberParameter. Defaults to “”.
allow_floats – Whether to allow floats. Defaults to False.
special_values – An iterable of the special values for the parameter. Defaults to None.
default – The default value for the parameter. Defaults to None.
description – A description of the parameter. Defaults to “”.
number_range – A NumberRange to use to limit the parameter. Defaults to None.
- classmethod from_dict(d) NumberParameter[source]¶
Initiate a NumberParameter from a dictionary.
- property number_range: NumberRange¶
The number range of the parameter.
- class autojob.coordinator.parameters.NumberRange(*, lower_bound: int | float = -inf, lower_bound_exclusive: bool = True, upper_bound: int | float = inf, upper_bound_exclusive: bool = True)[source]¶
Bases:
MSONableA range of numbers.
Initialize a NumberRange.
- Parameters:
lower_bound – The lower bound for the range.
lower_bound_exclusive – Whether the lower bound is excluded from the range.
upper_bound – The upper bound for the range.
upper_bound_exclusive – Whether the upper bound is excluded from the range.
- class autojob.coordinator.parameters.NumberSequenceParameter(*, name: str = '', allow_floats: bool = False, special_values: Iterable | None = None, default: Any = None, description: str = '', number_range: NumberRange = None)[source]¶
Bases:
SequenceParameterA parameter that can be a sequence of numbers.
Initialize a NumberSequenceParameter.
- Parameters:
name – The name of the NumberSequenceParameter. Defaults to “”.
allow_floats – Whether to allow floats. Defaults to False.
special_values – An iterable of the special values for the parameter. Defaults to None.
default – The default value for the parameter. Defaults to None.
description – A description of the parameter. Defaults to “”.
number_range – A NumberRange to use to limit the parameter. Defaults to None.
- classmethod from_dict(d) NumberSequenceParameter[source]¶
Initiate a SequenceParameter from a dictionary.
- class autojob.coordinator.parameters.SequenceParameter(member_types: Iterable[type], name: str = '', special_values: Iterable | None = None, default: Any = None, description: str = '')[source]¶
Bases:
CalculatorParameterA parameter that can be a sequence.
Initialize a SequenceParameter.
- Parameters:
name – The name of the SequenceParameter. Defaults to “”.
member_types – The allowed types of the items in the sequence.
special_values – An iterable of the special values for the parameter. Defaults to None.
default – The default value for the parameter. Defaults to None.
description – A description of the parameter. Defaults to “”.
- classmethod from_dict(d) SequenceParameter[source]¶
Initiate a SequenceParameter from a dictionary.
autojob.coordinator.validation module¶
Validate and convert values to desired types.
- autojob.coordinator.validation.alphanum_key(val: str) tuple[str, _T][source]¶
A key for alphanumerically sorting strings.
- Parameters:
val (str) – String representation of object for which to provide key.
- Raises:
TypeError – The type of ‘val’ is invalid.
- Returns:
Tuple[str, Union[bool, float, int, None, str]] – Key for ‘val’.
- autojob.coordinator.validation.alphanum_sort(vals: Iterable[str]) list[str][source]¶
Alphanumerically sorts ‘vals’.
- Parameters:
vals (Iterable) – Iterable to be sorted
- Returns:
List[str] – Alphanumerically sorted copy of ‘vals’.
- autojob.coordinator.validation.iter_to_native(vals: Iterable[float | int | str | None]) Iterable[float | int | str | None][source]¶
Converts elements of an iterable to their native types.
- Parameters:
vals (Iterable[Optional[float, int, str]]) – Iterable to be converted
- Returns:
Iterable – A shallow copy of the converted Iterable.
Example
>>> from autojob.coordinator.validation import iter_to_native >>> vals = ["0.1", "None", "-1", "dog"] >>> iter_to_native(vals) [0.1, None, -1, 'dog']
autojob.coordinator.vasp module¶
Parametrize VASP calculations.
Deprecated since version Use: autojob.calculation.vasp instead.
- class autojob.coordinator.vasp.VaspJob(job_id: str, calculation_id: str, study_id: str, study_group_id: str, input_parameters: dict, results: dict, job_stats: dict[str, str | int] | None, calculator_type: CalculatorType | None = None, calculation_type: CalculationType | None = None, study_type: StudyType | None = None, error: JobError | None = None, name: str = '', notes: str = '')[source]¶
Bases:
JobA VASP job.
Initialize a
Job.- Parameters:
job_id – The job ID.
calculation_id – The calculation ID.
study_id – The study ID.
study_group_id – The study group ID.
input_parameters – The input parameters for the job.
results – The job results.
job_stats – The job statistics.
calculator_type – The calculator type. Defaults to None.
calculation_type – The calculation type. Defaults to None.
study_type – The study type. Defaults to None.
error – The job error. Defaults to None.
name – The job name. Defaults to “”.
notes – Notes on the job. Defaults to “”.
- static input_parameters() list[CalculationParameter][source]¶
A list of VASP calculation parameters.