Conversation
|
| Filename | Overview |
|---|---|
| src/minimizer/bfgs_uff.cpp | New UFF BFGS minimizer; missing per-molecule FF-param caching present in the MMFF counterpart |
| nvmolkit/uffOptimization.py | New Python wrapper for UFF optimization; consistent scalar-or-sequence normalisation matching MMFF pattern |
| nvmolkit/uffOptimization.cpp | New Boost.Python bindings; clean extraction helpers with null-pointer guard |
| nvmolkit/tests/test_uff_optimization.py | New UFF test suite; make_fragmented_mol does not check EmbedMultipleConfs return value |
| nvmolkit/_uffOptimization.pyi | New C++ binding stub; vdwThresholds and ignoreInterfragInteractions typed as Any |
| src/minimizer/bfgs_common.cpp | Shared BFGS helpers extracted from bfgs_mmff; energies buffer sizing corrected vs. original |
| src/minimizer/bfgs_common.h | New shared header for ThreadLocalBuffers, ConformerInfo, and BatchExecutionContext |
| src/minimizer/bfgs_uff.h | New UFF minimizer header; clean signature in dedicated UFF namespace |
| src/minimizer/bfgs_mmff.cpp | Refactored to use shared bfgs_common helpers; logic and caching pattern unchanged |
| nvmolkit/CMakeLists.txt | Added _uffOptimization build target following existing _mmffOptimization pattern |
| nvmolkit/init.py | Minor docstring update noting UFF support |
| src/minimizer/CMakeLists.txt | Added bfgs_uff.cpp and bfgs_common.cpp source files |
Reviews (1): Last reviewed commit: "Consolidate things" | Re-trigger Greptile
| vdwThresholds: Any = ..., | ||
| ignoreInterfragInteractions: Any = ..., | ||
| hardwareOptions: Any = ..., |
There was a problem hiding this comment.
Weak
Any types reduce stub value
All three non-trivial parameters are typed as Any, eliminating IDE autocompletion and type-checker coverage for callers of the internal binding. The C++ layer already enforces concrete list types, so the stub can reflect them.
| vdwThresholds: Any = ..., | |
| ignoreInterfragInteractions: Any = ..., | |
| hardwareOptions: Any = ..., | |
| vdwThresholds: List[float] = ..., | |
| ignoreInterfragInteractions: List[bool] = ..., | |
| hardwareOptions: Any = ..., |
| rdDistGeom.EmbedMultipleConfs(mol, numConfs=1, params=params) | ||
| conf = mol.GetConformer() |
There was a problem hiding this comment.
EmbedMultipleConfs return value not checked
EmbedMultipleConfs returns a list of assigned conformer IDs (empty on failure). If embedding fails, the unchecked mol.GetConformer() on the next line raises ValueError: No conformers present, making the test failure hard to diagnose.
| rdDistGeom.EmbedMultipleConfs(mol, numConfs=1, params=params) | |
| conf = mol.GetConformer() | |
| confs_embedded = rdDistGeom.EmbedMultipleConfs(mol, numConfs=1, params=params) | |
| if not confs_embedded: | |
| raise RuntimeError("EmbedMultipleConfs failed for make_fragmented_mol(); check SMILES or random seed") | |
| conf = mol.GetConformer() |
| for (const auto& confInfo : batchConformers) { | ||
| const uint32_t numAtoms = confInfo.mol->getNumAtoms(); | ||
| conformerAtomStarts.push_back(currentAtomOffset); | ||
| currentAtomOffset += numAtoms; | ||
|
|
||
| nvMolKit::confPosToVect(*confInfo.conformer, pos); | ||
| auto ffParams = constructForcefieldContribs(*confInfo.mol, | ||
| vdwThresholds[confInfo.molIdx], | ||
| confInfo.conformerId, | ||
| ignoreInterfragInteractions[confInfo.molIdx]); | ||
| addMoleculeToBatch(ffParams, pos, systemHost, metadata, confInfo.molIdx, static_cast<int>(confInfo.confIdx)); | ||
| } |
There was a problem hiding this comment.
No per-molecule caching of FF params, unlike the MMFF counterpart
constructForcefieldContribs is called once per conformer. The MMFF implementation (bfgs_mmff.cpp) uses a moleculeCache keyed on ROMol* to call this only once per unique molecule per batch, since bond/angle/torsion/vdW topology parameters are conformer-independent. For batches containing molecules with many conformers, UFF re-derives the full force-field topology redundantly on every iteration.
No description provided.