Add custom options for MMFF optimization#124
Add custom options for MMFF optimization#124scal444 wants to merge 5 commits intoNVIDIA-Digital-Bio:mainfrom
Conversation
|
| Filename | Overview |
|---|---|
| nvmolkit/mmffOptimization.cpp | Replaces scalar nonBondedThreshold with a per-molecule properties list; adds extractMMFFProperties and extractMMFFPropertiesList helpers that unpack the Python transport object into nvMolKit::MMFFProperties. Size validation is sound. |
| nvmolkit/mmffOptimization.py | Public API adds properties, nonBondedThreshold, and ignoreInterfragInteractions parameters; normalisation helpers correctly handle scalar-vs-sequence and single-vs-list MMFFMolProperties. Logic for broadcasting a single config object to all molecules is intentional (nvMolKit derives atom-specific parameters from ROMol* in C++, not from the properties object). |
| nvmolkit/_mmffOptimization.pyi | Stub updated to reflect new properties parameter, but the declared default (None) does not match the C++ binding default (empty boost::python::list()); passing None directly to the extension would raise a Boost.Python TypeError. |
| nvmolkit/tests/test_mmff_optimization.py | Three new tests cover custom scalar properties, per-molecule properties, and per-molecule threshold/interfrag flags. make_fragmented_mol now uses a fixed seed (42) addressing the prior review comment. make_rdkit_mmff_properties correctly calls capture_mmff_settings so the bridge can extract config settings without relying on RDKit getter availability. |
| nvmolkit/types.py | Trivial formatting change — two blank lines added before the _embedMolecules import. No functional changes. |
Reviews (2): Last reviewed commit: "Format" | Re-trigger Greptile
nvmolkit/mmffOptimization.py
Outdated
| ) | ||
| for props, threshold, ignore_interfrag in zip(properties_list, thresholds, interfrag_flags) | ||
| ] | ||
| if len(native_properties) == 1: |
There was a problem hiding this comment.
Is there any specific reason we want to extract this single property instead of just passing in it as a list of one element?
There was a problem hiding this comment.
It matters for which src cpp path we take - https://github.com/NVIDIA-Digital-Bio/nvMolKit/blob/main/src/minimizer/bfgs_mmff.h#L38-L44, but you're right we didn't need it at this level. Fixed
evasnow1992
left a comment
There was a problem hiding this comment.
Changes look good to me. Thanks!
Allows better control over dielectric, interfrag interactions, and nonbond interaction limit. Partial implementation of #70