chemparseplot.parse.eon._trajectory_common#

Shared helpers for eOn trajectory parsers.

Module Contents#

Functions#

coerce_metadata_value

Coerce metadata strings back to the expected scalar type.

resolve_movie_file

Resolve an eOn movie file that may omit the .con suffix.

require_dat_file

Return a required trajectory data file or raise a helpful error.

read_first_structure

Read the first structure from an eOn CON file.

read_optional_first

Return the first matching optional CON structure from job_dir.

load_movie_and_table

Load the shared movie/data payload for an eOn trajectory parser.

metadata_value

Return a typed metadata value from a readcon frame.

frame_rows_to_table

Build a table from frame metadata when sidecar TSV data is absent.

load_optional_payload

Load an optional file payload if the path exists.

Data#

API#

chemparseplot.parse.eon._trajectory_common.log#

‘getLogger(…)’

chemparseplot.parse.eon._trajectory_common.T#

‘TypeVar(…)’

chemparseplot.parse.eon._trajectory_common._COLUMN_CASTERS: dict[str, collections.abc.Callable[[Any], Any]]#

None

chemparseplot.parse.eon._trajectory_common.coerce_metadata_value(column: str, value: Any) Any#

Coerce metadata strings back to the expected scalar type.

chemparseplot.parse.eon._trajectory_common.resolve_movie_file(job_dir: pathlib.Path, stem: str) pathlib.Path#

Resolve an eOn movie file that may omit the .con suffix.

chemparseplot.parse.eon._trajectory_common.require_dat_file(job_dir: pathlib.Path, name: str) pathlib.Path#

Return a required trajectory data file or raise a helpful error.

chemparseplot.parse.eon._trajectory_common.read_first_structure(path: pathlib.Path) ase.Atoms#

Read the first structure from an eOn CON file.

chemparseplot.parse.eon._trajectory_common.read_optional_first(job_dir: pathlib.Path, names: collections.abc.Sequence[str]) ase.Atoms | None#

Return the first matching optional CON structure from job_dir.

chemparseplot.parse.eon._trajectory_common.load_movie_and_table(job_dir: pathlib.Path, *, movie_stem: str, dat_name: str, parse_dat: collections.abc.Callable[[pathlib.Path], polars.DataFrame], metadata_columns: collections.abc.Sequence[str], build_table_from_metadata: collections.abc.Callable[[collections.abc.Sequence[object]], polars.DataFrame], log_label: str) tuple[list[ase.Atoms], polars.DataFrame]#

Load the shared movie/data payload for an eOn trajectory parser.

chemparseplot.parse.eon._trajectory_common.metadata_value(frame: object, key: str) Any#

Return a typed metadata value from a readcon frame.

chemparseplot.parse.eon._trajectory_common.frame_rows_to_table(frames: collections.abc.Sequence[object], columns: collections.abc.Sequence[str], *, allow_leading_incomplete: bool = False) polars.DataFrame#

Build a table from frame metadata when sidecar TSV data is absent.

chemparseplot.parse.eon._trajectory_common.load_optional_payload(path: pathlib.Path, loader: collections.abc.Callable[[pathlib.Path], chemparseplot.parse.eon._trajectory_common.T]) chemparseplot.parse.eon._trajectory_common.T | None#

Load an optional file payload if the path exists.