scine_puffin.utilities.program_helper

Classes

Cp2kHelper(manager, structure, calculation)

ProgramHelper(*arg, **kwargs)

A common interface for all helper classes for specific Scine calculators

class scine_puffin.utilities.program_helper.Cp2kHelper(manager: db.Manager, structure: db.Structure, calculation: db.Calculation)[source]
calculation_postprocessing(calculation: db.Calculation, old_structure: db.Structure, new_structure: db.Structure | None = None) None[source]

Write additional information into the database after the calculation in a job. This function has to be implemented by every subclass. This function must not throw exceptions.

Parameters:
calculationdb.Calculation (Scine::Database::Calculation)

The calculation that triggered the execution of the job.

old_structuredb.Structure (Scine::Database::Structure)

The structure which was calculated

new_structuredb.Structure (Scine::Database::Structure)

An optional resulting structure from the Calculation (e.g. optimized structure)

calculation_preprocessing(calculator: utils.core.Calculator, calculation_settings: utils.ValueCollection) None[source]

Makes the necessary preparations before the calculation in a job. This function has to be implemented by every subclass.

Parameters:
calculatorutils.core.calculator Scine::Core::Calculator)

The calculator to work on/with.

calculation_settingsutils.ValueCollection (Scine::Utils::ValueCollection)

The settings of the calculation in the database.

cutoff_handling(structure: db.Structure, settings: utils.ValueCollection)[source]
cutoffs_from_properties(structure: db.Structure) Tuple[float, float] | Tuple[None, None][source]
extract_cutoff_optimization_settings(settings: utils.ValueCollection) None[source]
classmethod get_correct_helper(program: str, manager: db.Manager, structure: db.Structure, calculation: db.Calculation) ProgramHelper | None

Returns the correct ProgramHelper Child class for the given program name or None if no suitable helper exists.

Parameters:
programstr

The name of the program, not case-sensitive.

managerdb.Manager (Scine::Database::Manager)

The manager of the database.

structuredb.Structure (Scine::Database::Structure)

The structure to be calculated, necessary for init of child.

calculationdb.Calculation (Scine::Database::Calculation)

The calculation that is carried out in the current job.

make_new_cutoff_properties(calculation: db.Calculation, structure: db.Structure, cutoff: float, rel_cutoff: float) None[source]
optimize_cutoffs(system: utils.core.Calculator, settings: utils.ValueCollection) None[source]
static program() str[source]

Must be implemented by every subclass. Returns the name of the program the helper is written for.

structure_has_cutoff_properties(structure: db.Structure) bool[source]
class scine_puffin.utilities.program_helper.ProgramHelper(*arg, **kwargs)[source]

A common interface for all helper classes for specific Scine calculators

abstract calculation_postprocessing(calculation: db.Calculation, old_structure: db.Structure, new_structure: db.Structure | None = None) None[source]

Write additional information into the database after the calculation in a job. This function has to be implemented by every subclass. This function must not throw exceptions.

Parameters:
calculationdb.Calculation (Scine::Database::Calculation)

The calculation that triggered the execution of the job.

old_structuredb.Structure (Scine::Database::Structure)

The structure which was calculated

new_structuredb.Structure (Scine::Database::Structure)

An optional resulting structure from the Calculation (e.g. optimized structure)

abstract calculation_preprocessing(calculator: utils.core.Calculator, calculation_settings: utils.ValueCollection) None[source]

Makes the necessary preparations before the calculation in a job. This function has to be implemented by every subclass.

Parameters:
calculatorutils.core.calculator Scine::Core::Calculator)

The calculator to work on/with.

calculation_settingsutils.ValueCollection (Scine::Utils::ValueCollection)

The settings of the calculation in the database.

classmethod get_correct_helper(program: str, manager: db.Manager, structure: db.Structure, calculation: db.Calculation) ProgramHelper | None[source]

Returns the correct ProgramHelper Child class for the given program name or None if no suitable helper exists.

Parameters:
programstr

The name of the program, not case-sensitive.

managerdb.Manager (Scine::Database::Manager)

The manager of the database.

structuredb.Structure (Scine::Database::Structure)

The structure to be calculated, necessary for init of child.

calculationdb.Calculation (Scine::Database::Calculation)

The calculation that is carried out in the current job.

abstract static program() str[source]

Must be implemented by every subclass. Returns the name of the program the helper is written for.