uppasd_tools.uppout

class uppasd_tools.uppout.UppOut(dir_path: str | Path, simid: str | None = None)

Bases: object

Main interface to UppASD simulation outputs.

It scans an output directory, infers the simulation ID, and catalogs which file types are available. When coord and restart files exist, it loads basic metadata (counts and coordinate ranges) for quick access.

dir_path

Path to the simulation output directory.

Type:

Path

prefixes

Sorted list of output file prefixes detected.

Type:

list[str]

simid

Simulation ID inferred from files or provided by user.

Type:

str | None

num_atoms

Total number of atoms in the simulation.

Type:

int | None

num_atoms_cell

Number of atoms in the unit cell.

Type:

int | None

num_atom_types

Number of unique atom types.

Type:

int | None

num_ens

Number of ensembles in the simulation.

Type:

int | None

xrange

(min, max) x-coordinates from coord file.

Type:

tuple[float, float] | None

yrange

(min, max) y-coordinates from coord file.

Type:

tuple[float, float] | None

zrange

(min, max) z-coordinates from coord file.

Type:

tuple[float, float] | None

atom_type(at_num: int) int

Return the atom type for a given atom number using the coord data.

final_configs() List[DataFrame]

Get final configurations of all ensembles from a restart file. Parameters: :returns: List of pandas DataFrames, each containing the configuration for an ensemble.

metadata() dict[str, object]

Return simulation metadata as a dictionary.

read_averages() DataFrame

Read an UppASD averages file into a pandas DataFrame.

read_coord() DataFrame

Read an UppASD coord file into a pandas DataFrame.

read_cumulants() DataFrame

Read an UppASD cumulants file into a pandas DataFrame.

read_energy() DataFrame

Read UppASD totenergy and stdenergy files into a pandas DataFrame.

read_projavgs() dict[int, DataFrame]

Read an UppASD projavgs file into a dict of DataFrames keyed by projection index.

read_projcumulants() dict[int, DataFrame]

Read an UppASD projcumulants file into a dict of DataFrames keyed by projection index.

read_restart() DataFrame

Read an UppASD restart file into a pandas DataFrame.

read_struct() DataFrame

Read an UppASD struct file into a pandas DataFrame.

summary() str

Return a formatted summary string of simulation metadata.