Skip to content

Trainset Yaml Engine Utility

Trainset YAML settings generation and orchestration utilities.

Usage context

  • Template generation: Produce canonical text payloads for ReaxFF artifacts.
  • File writing: Persist generated outputs to disk with stable formatting.
  • Workflow integration: Support higher-level ReaxKit workflow commands.

Class: TrainsetSettingsSpec

Represent TrainsetSettingsSpec.

Public class used by ReaxFF generator components.

Fields

out_path : str Dataclass field. name : str Dataclass field. source : str Dataclass field. mp_id : Optional[str] Dataclass field. formula_pretty : Optional[str] Dataclass field. crystal_system : Optional[str] Dataclass field. elastic_max_strain_percent : float Dataclass field. elastic_dstrain : float Dataclass field. cij_gpa : Dict[str, float] Dataclass field. elastic_cell : CellSpec Dataclass field. B0_gpa : float Dataclass field. B0_prime : float Dataclass field. bulk_max_volumetric_strain_percent : float Dataclass field. bulk_dstrain_linear : float Dataclass field. bulk_cell : CellSpec Dataclass field. trainset_file : str Dataclass field. tables : Dict[str, str] Dataclass field. elastic_xyz : Optional[str | Path] Dataclass field. bulk_xyz : Optional[str | Path] Dataclass field. geo_enable : bool Dataclass field. geo_sort_by : Optional[str] Dataclass field.

Function: gen_template_yaml_for_elastic_settings

Gen template yaml for elastic settings.

Parameters:

Name Type Description Default
spec TrainsetSettingsSpec | None

Input parameter.

None
out_path str | Path | None

Keyword-only parameter.

None

Returns:

Type Description
str | Path

Return value.

Examples:

# Example
gen_template_yaml_for_elastic_settings(...)

Function: gen_template_yaml_for_heatfo_settings

Gen template yaml for heatfo settings.

Parameters:

Name Type Description Default
out_path str | Path

Keyword-only parameter.

required

Returns:

Type Description
Path

Return value.

Examples:

# Example
gen_template_yaml_for_heatfo_settings(...)

Function: gen_elastic_trainset

Gen elastic trainset.

Parameters:

Name Type Description Default
out_dir str | Path

Keyword-only parameter.

required
source str

Keyword-only parameter.

'mp'
input_mode str

Keyword-only parameter.

'yaml'
yaml_path str | None

Keyword-only parameter.

None
mat_id str | None

Keyword-only parameter.

None
elements str | None

Keyword-only parameter.

None
element_count_scope str

Keyword-only parameter.

'exact'
max_materials int | None

Keyword-only parameter.

None
api_key str | None

Keyword-only parameter.

None
bulk_mode str

Keyword-only parameter.

'voigt'
crystallographic_setting_conversion str

Keyword-only parameter.

'to-primitive'
out_yaml str

Keyword-only parameter.

'trainset_settings_source.yaml'
structure_dir str | Path | None

Keyword-only parameter.

None
skip_no_orthogonal bool

Keyword-only parameter.

False
verbose bool

Keyword-only parameter.

False
weight float | None

Keyword-only parameter.

None

Returns:

Type Description
dict[str, Any]

Return value.

Examples:

# Example
gen_elastic_trainset(...)