"""pyztraj — fast molecular dynamics trajectory analysis powered by Zig."""

from pyztraj._ffi import get_ffi, get_lib
from pyztraj._helpers import ZtrajError
from pyztraj.analysis import (
    Contact,
    HBond,
    PcaResult,
    SasaResult,
    compute_contacts,
    compute_dssp,
    compute_native_contacts_q,
    compute_pca,
    compute_rdf,
    compute_sasa,
    detect_hbonds,
)
from pyztraj.combined import analyze_all
from pyztraj.geometry import (
    compute_angles,
    compute_center_of_geometry,
    compute_center_of_mass,
    compute_chi,
    compute_dihedrals,
    compute_distances,
    compute_inertia,
    compute_msd,
    compute_omega,
    compute_phi,
    compute_principal_moments,
    compute_psi,
    compute_rg,
    compute_rmsd,
    compute_rmsf,
    make_molecules_whole,
    minimum_image_distance,
    wrap_coords,
)
from pyztraj.io import (
    DcdReader,
    Structure,
    TrrReader,
    TrrWriter,
    XtcReader,
    XtcWriter,
    load_gro,
    load_mmcif,
    load_pdb,
    open_dcd,
    open_trr,
    open_xtc,
    write_gro,
    write_pdb,
)


def get_version() -> str:
    """Get the ztraj library version string."""
    return get_ffi().string(get_lib().ztraj_version()).decode("utf-8")


__all__ = [
    "Contact",
    "HBond",
    "PcaResult",
    "SasaResult",
    "Structure",
    "XtcReader",
    "XtcWriter",
    "TrrReader",
    "TrrWriter",
    "DcdReader",
    "ZtrajError",
    "analyze_all",
    "compute_angles",
    "compute_center_of_geometry",
    "compute_center_of_mass",
    "compute_chi",
    "compute_contacts",
    "compute_dihedrals",
    "compute_distances",
    "compute_dssp",
    "compute_inertia",
    "compute_msd",
    "compute_native_contacts_q",
    "compute_omega",
    "compute_pca",
    "compute_phi",
    "compute_principal_moments",
    "compute_psi",
    "compute_rdf",
    "compute_rg",
    "compute_rmsd",
    "compute_rmsf",
    "compute_sasa",
    "detect_hbonds",
    "get_version",
    "load_gro",
    "load_mmcif",
    "load_pdb",
    "make_molecules_whole",
    "minimum_image_distance",
    "open_dcd",
    "open_trr",
    "open_xtc",
    "wrap_coords",
    "write_gro",
    "write_pdb",
]
