Skip to content

Benchmark environment

Set up the environment once in the MolGR repository. Choose a runner according to where your coordinates and reference graphs come from. 简体中文

Input Coordinates and reference graph Guide
Published dataset Coordinates and reference supplied for that dataset Reproduce the five-dataset benchmark
List of SMILES Generate coordinates from each SMILES and compare against the original graph SMILES inputs
Molfile or SDF Read the coordinates and graph from the file Molfile and SDF inputs

Environment

With uv and Python 3.10 available, run these commands from the repository root. The first creates or refreshes the environment. In a new shell, only the activation step is needed.

bash scripts/benchmark_env.sh create
source .venv-benchmark/bin/activate

The script uses python3.10 and creates .venv-benchmark by default. MolGR supports Python 3.8 and later. The benchmark environment uses Python 3.10 or 3.11 and NumPy below 2 for compatibility with xyzgraph, cell2mol, and cosymlib. Dependencies · Lockfile

Run one command with uv or switch the current shell

For one command, use the script’s run entry point. For example, display the SMILES runner’s options.

bash scripts/benchmark_env.sh run python -m benchmarks.smiles_xyz_benchmark.run --help

To run several commands with uv, select the benchmark project for the shell and clear its settings when finished.

eval "$(bash scripts/benchmark_env.sh env)"
uv run --frozen --no-sync python -m benchmarks.smiles_xyz_benchmark.run --help
unset UV_PROJECT UV_PROJECT_ENVIRONMENT UV_PYTHON

Available methods

The SMILES and Molfile runners try every registered method for each input. The dataset runner selects one method per run with --method. To compare the two MolGR backends, run each on the same SQLite input database. Method registry

Implementation Method ID
MolGR C++ / Python molgr_cpp / molgr_fallback
RDKit / Open Babel rdkit_determine_bonds / openbabel_read_xyz
cell2mol v2 / xyzgraph cell2mol_v2 / xyzgraph_cheminf_full
xyz2mol_tm xyz2mol_tm
Install the optional xyz2mol_tm baseline

Run these commands from the repository root. The pinned wheel omits the Hückel subpackage. An editable installation exposes the full source tree to the adapter.

git clone https://github.com/jensengroup/xyz2mol_tm.git .local/third-party/xyz2mol_tm
git -C .local/third-party/xyz2mol_tm checkout db2734b084045ef895528c7a3d5040d38da23983
uv pip install --python .venv-benchmark/bin/python --no-deps -e .local/third-party/xyz2mol_tm

The benchmark environment already includes RDKit with rdEHTTools, NumPy, and NetworkX. If an environment sync removes the optional package, repeat the last command.

For the five published datasets, the adapter selects the generic or Hückel entry point by element. The Hückel path accepts total charge and preserves coordination bonds. Its upstream SMILES round trip loses coordinates, so the adapter skips coordinate-dependent postprocessing. Timing includes temporary file I/O and serialization. A serialization error can still leave a graph for scoring. Method inputs and routing

In custom scripts, import the shared method registry before MolGR. It loads RDKit’s Hückel and MolStandardize modules in the order required by the Linux native libraries. Restart in a fresh process if the adapter reports an import-order error.

cell2mol v2 source and license

The benchmark uses the upstream v2 branch. Check the license for that revision, including applicable GPL obligations, when enabling or distributing the baseline. cell2mol v2

Interpret the results

The SMILES and Molfile runners write two CSV files under --out. Compare methods in summary.csv and look up individual cases in results.csv. The published-dataset runner stores cases in SQLite and summarizes them in JSON. Summarize a dataset run

Question Fields Interpretation
Which attempt? case_idx, method_id Together these identify one case and method.
Is the reference eligible? reference_status, reference_reason Only valid enters the denominator. Other references are excluded or unresolved.
Did the graphs match? evaluator_decision equivalent, not_equivalent, and inconclusive distinguish a match, a mismatch, and an undecided comparison.
Did the method report an error? status, error A graph retained after an error can still be compared. Eligible cases without a verdict stay in the denominator.
Where was time spent? method_ms, equivalence_ms Method execution and graph comparison are timed separately in milliseconds.
Audit counts, predicted structures, and timings

In summary.csv, count is the eligible reference count. It equals success_count + fail_count + inconclusive_count + runtime_failure_count. The last counts attempts without a verdict. API errors are counted separately in api_error_count, including matches recorded in matched_with_errors.

In results.csv, inspect input_smiles, ground_truth_smiles, and predicted_smiles alongside equivalence_method. The reconstruction time is timing_ms_total. Method-specific timings are available in separate columns and in timing_ms_breakdown_json.