Imported from AI4MS/MatCreator (
src/matcreator/skills/structure-conversion/SKILL.md). Install upstream withnpx skills add AI4MS/MatCreator --skill structure-conversion. Copyright stays with the author.
Overview
Use the CLI script structure_conversion_tools.py (located alongside this file) to convert structure files between extxyz and cif. It mirrors the behavior of the former ase_structure_convert_tool and is especially useful for turning MatterGen multi-frame extxyz outputs into per-frame cif files.
Every command writes a JSON object to stdout and exits 0 on success or 1 on error. Always parse the JSON output and confirm "status": "success".
python skills/structure_conversion/structure_conversion_tools.py convert <input_file> <output_path> [options]
Supported Conversions
cif->extxyz- single-frame
extxyzorxyz-> singlecif - multi-frame
extxyzorxyz-> directory of per-frameciffiles extxyzorxyz->extxyz
For multi-frame extxyz input, never collapse all frames into one cif. Write one cif file per frame using stable names such as frame_000001.cif.
Command
convert
Convert a structure file and return output metadata.
Positional arguments
| Argument | Description |
|---|---|
input_file |
Source structure path. Supported: .extxyz, .xyz, .cif |
output_path |
Output file path or output directory |
Optional arguments
| Flag | Type | Description |
|---|---|---|
--output-format |
str | Explicit target format: cif or extxyz. If omitted, infer from output_path |
JSON response fields
status, message, output_mode, output_format, frame_count, output_path, output_paths
Recommended Behavior
- Prefer directory outputs when converting multi-frame
extxyztocif - Always return absolute paths
- Report the output mode, frame count, output directory or file, and all generated paths
- Surface exact parsing or conversion errors from ASE
Examples
# Multi-frame extxyz to per-frame CIF directory
python skills/structure_conversion/structure_conversion_tools.py convert \
generated.extxyz converted_cifs --output-format cif
# Single CIF to extxyz
python skills/structure_conversion/structure_conversion_tools.py convert \
structure.cif structure.extxyz
Notes
- This skill is commonly used after
mattergengeneration and before downstream property prediction - If
output_formatis omitted, the script infers it fromoutput_path - If the input contains multiple frames and the target is
cif, the result is a directory, not a single file