Skip to content

New tutorials, similarity threshold support & RdkitReaction improvements - #26

Merged
asiomchen merged 2 commits into
mainfrom
new-feat
Mar 1, 2026
Merged

asiomchen merged 2 commits into
mainfrom
new-feat

Conversation

@asiomchen

Copy link
Copy Markdown
Owner
  • RdkitReaction.bind_processor — Validates and converts reaction input (SMILES/SMARTS strings or ChemicalReaction
    objects) before sending to the database, with bind_expression using reaction_from_smarts(). Previously, invalid
    reaction strings were silently accepted.
  • RdkitReaction.result_processor fix — Added missing else branch for return_type="mol" with string input (previously
    fell through to None).
  • RDKit similarity threshold settings — New molalchemy.rdkit.settings module with get/set_tanimoto_threshold,
    get/set_dice_threshold, and a similarity_threshold context manager.
  • Alembic helpers — Extended render_item to handle RdkitIndex and Bingo index types; added repr to index classes.
  • Bingo index refactor — Extracted _BingoIndexBase to DRY up the four Bingo index classes.
  • RDKit integration tests — New tests/rdkit/test_integration.py with 9 SQL compilation tests (substructure @>, exact
    match @=, tanimoto %, dice #, nearest neighbors <%>, complex queries, ORM queries, tanimoto_sml function).
  • Unit tests — New tests for RdkitReaction.bind_processor, result_processor mol string fallback, similarity settings,
    and alembic helpers.
  • Tutorials — New similarity threshold settings notebook (04) and reactions notebook (05).

- Introduced `settings.py` for managing RDKit similarity thresholds (Tanimoto and Dice) with functions to get and set these values.
- Implemented a context manager `similarity_threshold` for temporary threshold adjustments.
- Updated `index.py` to include a more structured representation for RDKit indexes.
- Refactored Bingo index classes to inherit from a common base class for shared functionality.
- Enhanced tests for RDKit settings to validate threshold management and context manager behavior.
- Added tests for rendering all index types in the alembic helpers module.
…implement bind and result processors for RDKit reactions, and add integration tests for RDKit query structures and types.
@codecov

codecov Bot commented Mar 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.61%. Comparing base (6e5c3ef) to head (5940e70).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/molalchemy/rdkit/types.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   79.32%   80.61%   +1.29%     
==========================================
  Files          21       22       +1     
  Lines        1543     1620      +77     
  Branches       26       39      +13     
==========================================
+ Hits         1224     1306      +82     
+ Misses        311      307       -4     
+ Partials        8        7       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@asiomchen
asiomchen merged commit ed7035e into main Mar 1, 2026
16 checks passed
@asiomchen
asiomchen deleted the new-feat branch March 21, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant