API Reference#

Complete API documentation for airsspy modules and classes.

Core Modules#

airsspy.seed

SeedAtoms, BuildcellParam, and tag classes for seed generation.

api/airsspy/airsspy.seed
airsspy.build

Buildcell class for interfacing with AIRSS buildcell executable.

api/airsspy/airsspy.build
airsspy.restools

RESFile and utilities for handling CASTEP .res files.

api/airsspy/airsspy.restools
airsspy.utils

Utility functions for file parsing and data processing.

api/airsspy/airsspy.utils

Quick Navigation#

Main Classes#

  • SeedAtoms - Core class for creating structure seeds

  • Buildcell - Wrapper for buildcell executable

  • RESFile - RES file handler with structure and metadata

Tag Classes#

RES File Functions#

  • save_airss_res() - Save structure in RES format

  • read_res_atoms() - Read RES file to Atoms

  • read_res_pmg() - Read RES file to pymatgen Structure

  • extract_res() - Extract metadata from RES file

  • parse_titl() - Parse TITL line

Utility Functions#

  • get_spacegroup_atoms() - Detect space group

  • get_minsep() - Calculate minimum separations

  • format_minsep() - Format minsep dictionary

  • calc_kpt_tuple_recip() - Calculate k-point mesh

Module Index#

Usage Examples#

Creating Seeds#

from airsspy import SeedAtoms

# Create a seed
seed = SeedAtoms('Si8', cell=[5, 5, 5], pbc=True)
seed[0].num = 8
seed.gentags.minsep = 2.0
seed.gentags.varvol = 20

# Generate structure
atoms = seed.build_random_atoms()

Using Buildcell#

from airsspy import Buildcell

# Create Buildcell instance
builder = Buildcell(seed)

# Generate with custom timeout
atoms = builder.generate(timeout=30)

Working with RES Files#

from airsspy import RESFile, save_airss_res

# Read RES file
res = RESFile.from_file('structure.res')
print(f"Formula: {res.formula}")
print(f"Enthalpy: {res.enthalpy:.4f} eV")

# Save structure
info_dict = {
    'uid': 'test-1',
    'P': 0.0,
    'V': atoms.get_volume(),
    'H': atoms.get_potential_energy(),
    'nat': len(atoms),
    'sym': 'P1'
}
save_airss_res(atoms, info_dict, 'output.res')

Type Hints#

airsspy uses type hints throughout for better IDE support and code clarity. Import types from modules:

from airsspy.seed import SeedAtoms, BuildcellParam
from airsspy.build import Buildcell
from airsspy.restools import RESFile, TitlInfo

See Also#