Skip to content

v0.3.0rc1

Pre-release
Pre-release

Choose a tag to compare

@sveccham sveccham released this 20 Jul 22:04
· 4 commits to main since this release

v0.3.0rc1

Highlights

This release adds Condensed Graph of Reaction (CGR) featurization for chemical reactions — a native C++ path to accelerate Chemprop-style reaction property prediction (~9x faster than the Python implementation).

New Features

  • batch_reaction_featurizer — Featurize a batch of atom-mapped reactions into CGR atom and bond features. Returns 5 NumPy arrays:
    1. CGR atom features (total_num_atoms, cgr_atom_feature_dim) — feature dim doubled (reactant + product)
    2. CGR bond features (total_num_directed_edges, cgr_bond_feature_dim)
    3. Edge index in COO format (2, total_num_directed_edges)
    4. Reverse edge index (total_num_directed_edges,)
    5. Associate node index mapping each node to its reaction (total_num_atoms,)
  • All 6 reaction modes supported: REAC_DIFF (default), REAC_PROD, PROD_DIFF, and their _BALANCE variants.
  • reaction_mode_to_int(name) — Convert a reaction mode name (e.g. "REAC_DIFF") to its integer enum value; raises on an unknown name.
  • keep_h / add_h support for reactions, mirroring the molecule featurizers.

Documentation

  • New docs/USAGE.md section covering CGR reaction featurization, including atom-mapping requirements, mode selection, and keep_h/add_h semantics.
  • Documented return arrays and usage for batch_reaction_featurizer.
  • Attributed RDB7 reaction test data (CC BY 4.0) and third-party licenses.

Testing

  • Added regression tests for batch_reaction_featurizer (tests/python/test_reaction_features.py).
  • Reaction goldens are generated from Chemprop (not cuik-molmaker) to validate correctness against the reference implementation.
  • RDB7 sample (sample_rxns_100.csv) is reproducible from Zenodo; goldens cover all mode × feature-set combinations (ORGANIC / RIGR / V1 / V2).

Build / Chore

  • Added .bumpversion.cfg for version management; bumped to 0.3.0rc1.
  • Updated CMakeLists.txt, setup.py, and .gitignore.

Notes / Caveats

  • Reactant and product SMILES must be atom-mapped (matching :N map numbers on both sides). Providing a correct, unique mapping is the caller's responsibility — duplicate map numbers on a side are not validated.
  • add_h adds unmapped hydrogens via RDKit AddHs, which become reactant-/product-only phantom atoms in a CGR and are usually not desired.

Full changelog: v0.2.1...v0.3.0rc1