chemparseplot.parse.chemgp_jsonl#

Parsers for ChemGP JSONL output formats.

ChemGP Rust examples produce JSONL files with method comparison data, GP quality grids, and RFF approximation benchmarks. This module provides structured parsing into typed containers for downstream plotting.

.. versionadded:: 1.5.0

Module Contents#

Classes#

ComparisonRecord

One optimizer-step record from a comparison JSONL.

OptimizerTrace

Single optimizer trace from a comparison JSONL.

ComparisonData

Parsed optimizer comparison from a single JSONL file.

RFFExactRecord

Exact-GP benchmark reference record.

RFFApproxRecord

One random-feature approximation benchmark record.

RFFQualityData

Parsed RFF approximation quality data.

GPQualityGrid

GP quality grid data for a single training set size.

GPGridRecord

One grid-sample record from the GP-quality JSONL.

TrainingPointSet

Accumulated training points for a single n_train value.

StationaryPoint

A stationary point (minimum or saddle) on the PES.

GPQualityData

Complete GP quality data from mb_gp_quality.jsonl.

Functions#

parse_comparison_jsonl

Parse a ChemGP optimizer comparison JSONL file.

parse_rff_quality_jsonl

Parse a ChemGP RFF quality JSONL file.

parse_gp_quality_jsonl

Parse a ChemGP GP quality JSONL file.

API#

class chemparseplot.parse.chemgp_jsonl.ComparisonRecord[source]#

One optimizer-step record from a comparison JSONL.

method: str#

None

oracle_calls: int#

None

step: int | None#

None

energy: float | None#

None

force: float | None#

None

max_force: float | None#

None

classmethod from_mapping(rec: chemparseplot.parse.types.ParserAttrs) chemparseplot.parse.chemgp_jsonl.ComparisonRecord[source]#
class chemparseplot.parse.chemgp_jsonl.OptimizerTrace[source]#

Single optimizer trace from a comparison JSONL.

Attributes

method : str Optimizer name (e.g. "gp_minimize", "neb", "otgpd"). steps : list[int] Step indices. oracle_calls : list[int] Cumulative oracle call counts. energies : list[float] | None Energy at each step (minimize, dimer). forces : list[float] | None Force norm at each step (dimer: force, NEB: max_force).

method: str#

None

steps: list[int]#

‘field(…)’

oracle_calls: list[int]#

‘field(…)’

energies: list[float] | None#

None

forces: list[float] | None#

None

add_record(rec: chemparseplot.parse.chemgp_jsonl.ComparisonRecord) None[source]#

Accumulate one typed optimizer record into the trace.

class chemparseplot.parse.chemgp_jsonl.ComparisonData[source]#

Parsed optimizer comparison from a single JSONL file.

Attributes

traces : dict[str, OptimizerTrace] Keyed by method name. summary : ParserAttrs | None Summary record if present.

traces: dict[str, chemparseplot.parse.chemgp_jsonl.OptimizerTrace]#

‘field(…)’

summary: chemparseplot.parse.types.ParserAttrs | None#

None

ensure_trace(method: str) chemparseplot.parse.chemgp_jsonl.OptimizerTrace[source]#

Return the named optimizer trace, creating it if needed.

chemparseplot.parse.chemgp_jsonl.parse_comparison_jsonl(path: str | pathlib.Path) chemparseplot.parse.chemgp_jsonl.ComparisonData[source]#

Parse a ChemGP optimizer comparison JSONL file.

Handles minimize, dimer, and NEB comparison formats. Each line is a JSON object with a method field (or summary: true).

Parameters

path Path to the JSONL file.

Returns

ComparisonData Parsed traces keyed by method name.

class chemparseplot.parse.chemgp_jsonl.RFFExactRecord[source]#

Exact-GP benchmark reference record.

energy_mae: float#

None

gradient_mae: float#

None

classmethod from_mapping(rec: chemparseplot.parse.types.ParserAttrs) chemparseplot.parse.chemgp_jsonl.RFFExactRecord[source]#
class chemparseplot.parse.chemgp_jsonl.RFFApproxRecord[source]#

One random-feature approximation benchmark record.

d_rff: int#

None

energy_mae_vs_true: float#

None

gradient_mae_vs_true: float#

None

energy_mae_vs_gp: float#

None

gradient_mae_vs_gp: float#

None

classmethod from_mapping(rec: chemparseplot.parse.types.ParserAttrs) chemparseplot.parse.chemgp_jsonl.RFFApproxRecord[source]#
class chemparseplot.parse.chemgp_jsonl.RFFQualityData[source]#

Parsed RFF approximation quality data.

Attributes

exact_energy_mae : float Exact GP energy MAE vs true surface. exact_gradient_mae : float Exact GP gradient MAE vs true surface. d_rff_values : list[int] RFF feature counts tested. energy_mae_vs_true : list[float] RFF energy MAE vs true surface. gradient_mae_vs_true : list[float] RFF gradient MAE vs true surface. energy_mae_vs_gp : list[float] RFF energy MAE vs exact GP. gradient_mae_vs_gp : list[float] RFF gradient MAE vs exact GP.

exact_energy_mae: float#

0.0

exact_gradient_mae: float#

0.0

d_rff_values: list[int]#

‘field(…)’

energy_mae_vs_true: list[float]#

‘field(…)’

gradient_mae_vs_true: list[float]#

‘field(…)’

energy_mae_vs_gp: list[float]#

‘field(…)’

gradient_mae_vs_gp: list[float]#

‘field(…)’

add_exact_gp(rec: chemparseplot.parse.chemgp_jsonl.RFFExactRecord) None[source]#

Store the exact-GP reference metrics.

add_rff(rec: chemparseplot.parse.chemgp_jsonl.RFFApproxRecord) None[source]#

Store one RFF approximation record.

chemparseplot.parse.chemgp_jsonl.parse_rff_quality_jsonl(path: str | pathlib.Path) chemparseplot.parse.chemgp_jsonl.RFFQualityData[source]#

Parse a ChemGP RFF quality JSONL file.

Parameters

path Path to the JSONL file.

Returns

RFFQualityData Parsed exact GP and RFF metrics.

class chemparseplot.parse.chemgp_jsonl.GPQualityGrid[source]#

GP quality grid data for a single training set size.

Attributes

n_train : int Number of training points. nx : int Grid x resolution. ny : int Grid y resolution. x : list[list[float]] Grid x coordinates (ny x nx). y : list[list[float]] Grid y coordinates (ny x nx). true_e : list[list[float]] True energy on grid. gp_e : list[list[float]] GP predicted energy on grid. gp_var : list[list[float]] GP variance on grid. train_x : list[float] Training point x coordinates. train_y : list[float] Training point y coordinates. train_e : list[float] Training point energies.

n_train: int#

0

nx: int#

0

ny: int#

0

x: list[list[float]]#

‘field(…)’

y: list[list[float]]#

‘field(…)’

true_e: list[list[float]]#

‘field(…)’

gp_e: list[list[float]]#

‘field(…)’

gp_var: list[list[float]]#

‘field(…)’

train_x: list[float]#

‘field(…)’

train_y: list[float]#

‘field(…)’

train_e: list[float]#

‘field(…)’

classmethod from_records(*, n_train: int, meta: chemparseplot.parse.types.ParserAttrs, records: list[chemparseplot.parse.chemgp_jsonl.GPGridRecord], train_points: chemparseplot.parse.chemgp_jsonl.TrainingPointSet | None = None) chemparseplot.parse.chemgp_jsonl.GPQualityGrid[source]#

Build a typed grid from JSONL records and parsed metadata.

class chemparseplot.parse.chemgp_jsonl.GPGridRecord[source]#

One grid-sample record from the GP-quality JSONL.

ix: int#

None

iy: int#

None

x: float#

None

y: float#

None

true_e: float#

None

gp_e: float#

None

gp_var: float#

None

classmethod from_mapping(rec: chemparseplot.parse.types.ParserAttrs) chemparseplot.parse.chemgp_jsonl.GPGridRecord[source]#
class chemparseplot.parse.chemgp_jsonl.TrainingPointSet[source]#

Accumulated training points for a single n_train value.

x: list[float]#

‘field(…)’

y: list[float]#

‘field(…)’

e: list[float]#

‘field(…)’

append(*, x: float, y: float, energy: float) None[source]#
class chemparseplot.parse.chemgp_jsonl.StationaryPoint[source]#

A stationary point (minimum or saddle) on the PES.

kind: str#

None

id: int#

None

x: float#

None

y: float#

None

energy: float#

None

class chemparseplot.parse.chemgp_jsonl.GPQualityData[source]#

Complete GP quality data from mb_gp_quality.jsonl.

Attributes

meta : ParserAttrs Grid metadata (nx, ny, x_min, x_max, y_min, y_max). stationary : list[StationaryPoint] Minima and saddle points. grids : dict[int, GPQualityGrid] Grid data keyed by n_train.

meta: chemparseplot.parse.types.ParserAttrs#

‘field(…)’

stationary: list[chemparseplot.parse.chemgp_jsonl.StationaryPoint]#

‘field(…)’

grids: dict[int, chemparseplot.parse.chemgp_jsonl.GPQualityGrid]#

‘field(…)’

chemparseplot.parse.chemgp_jsonl.parse_gp_quality_jsonl(path: str | pathlib.Path) chemparseplot.parse.chemgp_jsonl.GPQualityData[source]#

Parse a ChemGP GP quality JSONL file.

Parameters

path Path to the JSONL file (e.g. mb_gp_quality.jsonl).

Returns

GPQualityData Structured grid data with metadata and stationary points.