Skip to content

Prepare release v.1.3.2

Choose a tag to compare

@TieuLongPhan TieuLongPhan released this 04 May 09:11
· 5 commits to main since this release
3b67dce

Changelog

[1.3.2] - 2026-05-04

Fixed

synkit/IO/mol_to_graph.py

  • Bug: _create_detailed_graph had incorrect default parameters
    (drop_non_aam=True, use_index_as_atom_map=True). Changed both defaults
    to False, consistent with the public mol_to_graph and
    _create_light_weight_graph methods.
  • Bug: atomLabelFontSize is not a valid MolDrawOptions attribute in
    current RDKit versions. Replaced with baseFontSize in rxn_vis.py.

synkit/Chem/Molecule/atom_features.py

  • Removed implicit_hcount from _build_minimal. This field duplicated
    information already available via hcount (GetTotalNumHs()), which
    already accounts for both explicit and implicit hydrogens.
  • Updated atom-feature tests to match the current minimal-profile output and
    assert that implicit_hcount is no longer emitted.

synkit/Chem/Reaction/standardize.py

  • Added user control for invalid reaction fragments via remove_invalid.
    Existing behavior is preserved with remove_invalid=True, which drops
    invalid fragments and standardizes the remaining valid molecules.
  • When remove_invalid=False, standardize_rsmi() and fit() now return
    None if any reactant or product fragment is invalid, instead of silently
    removing it.

Added

GitHub Actions

  • verify-pypi-install.yml now verifies synkit[all] installation on both
    Linux (ubuntu-latest) and macOS (macos-latest).
  • conda-forge-publish.yml now validates conda recipe builds on both Linux
    and macOS before publishing.
  • Conda publishing remains a single Ubuntu-built artifact because the recipe is
    noarch: python.

synkit/IO/mol_to_graph.pyradical attribute

  • _create_light_weight_graph: added radical node attribute
    (atom.GetNumRadicalElectrons()), which was silently missing.
  • _augment_atom_properties: now always sets radical explicitly,
    ensuring it is present regardless of which AtomFeatureExtractor path is
    taken.

synkit/IO/mol_to_graph.py — profile-aware node attributes

  • _augment_atom_properties and _gather_atom_properties now accept a
    profile keyword argument ("minimal" or "full", default "full").
  • transform() forwards self.attr_profile to both methods, so the
    "minimal" profile no longer emits verbose intermediate fields.
  • Minimal profile node keys: element, aromatic, hcount, charge,
    radical, isomer, partial_charge, hybridization, in_ring,
    neighbors, atom_map, oxidation_state, available_lp, lone_pairs.
  • Full profile additionally includes: bond_order_sum,
    lp_bond_order_sum, valence_electrons, estimated_lone_pairs,
    available_lone_pairs.
  • _create_light_weight_graph (legacy mol_to_graph(light_weight=True))
    aligned to minimal-profile semantics: removed bond_order_sum,
    lp_bond_order_sum, estimated_lone_pairs, available_lone_pairs.

synkit/Vis/rxn_vis.py — reaction-center highlighting

  • New constructor parameters: highlight_reaction_center (bool),
    rc_atom_color, rc_broken_color, rc_formed_color.
  • New static method _find_reaction_center(rsmi): compares mapped-bond
    connectivity on the reactant and product sides to identify formed bonds,
    broken bonds, order-changed bonds, and the atoms involved. Parses with
    SmilesParserParams(removeHs=False) to correctly handle explicitly mapped
    hydrogen atoms (e.g. [H:7]).
  • New instance methods _draw_mol, _render_rc, _make_separator,
    _compose_reaction_image: draw each molecule individually with per-atom
    and per-bond highlight colors, then compose the full reaction image with
    + and arrow separators.
  • When highlight_reaction_center=True but no atom mapping is detected,
    falls back to the standard DrawReaction layout automatically.
  • Existing render(), save_png(), save_pdf() public API unchanged.
  • Docstrings converted to :param: / :type: style throughout.

Changed

synkit/IO/mol_to_graph.py — docstring improvements

  • _augment_atom_properties: lists all guaranteed output fields by profile.
  • _gather_atom_properties: enumerates minimal vs full key sets.
  • _create_light_weight_graph: documents current node/edge attribute sets
    and clarifies use_index_as_atom_map fallback behaviour.

Tests

Test/Chem/Reaction/test_standardize.py

  • Added coverage for mixed valid/invalid reaction fragments.
  • Added tests for default invalid-fragment removal and strict
    remove_invalid=False behavior in both standardize_rsmi() and fit().

Test/IO/test_mol_to_graph.py

Expanded from 4 to 37 test cases covering:

  • Constructor validation (invalid profile, valid profiles, __repr__).
  • transform node keys (minimal asserts absence of verbose fields; full
    asserts their presence), edge keys, whitelists, drop_non_aam,
    use_index_as_atom_map.
  • transform_store / graph property (including RuntimeError before
    store).
  • mol_to_graph legacy classmethod (basic, light_weight=True,
    drop_non_aam error path).
  • radical attribute: zero for closed-shell molecules, non-zero for radical
    species, present in light-weight graph.
  • Lone-pair estimation: estimate_lone_pairs for water oxygen and pyrrolic N,
    estimate_available_lone_pairs for pyrrolic N (must be 0), available_lp
    flag.
  • Oxidation-state estimation: estimate_oxidation_states,
    oxidation_states_by_atom_map, reaction_oxidation_state_delta_from_rsmi.
  • Static helpers: add_partial_charges, get_stereochemistry,
    get_bond_stereochemistry, has_atom_mapping, random_atom_mapping.