Skip to content

feat: add simple conformer sdf file caching. - #1

Open
KalenJosifovski wants to merge 2 commits into
dehaenw:mainfrom
KalenJosifovski:codex/conformer-sdf-cache
Open

feat: add simple conformer sdf file caching.#1
KalenJosifovski wants to merge 2 commits into
dehaenw:mainfrom
KalenJosifovski:codex/conformer-sdf-cache

Conversation

@KalenJosifovski

Copy link
Copy Markdown

Summary

Add an opt-in on-disk SDF conformer cache to CASPER.

What changed

  • Added cache_sdf and cache_dir to CasperConfig
  • Routed featurize(...), featurize_bag(...), and embed_many(...) through a cache-aware embedding path
  • Store and reload conformers from deterministic per-molecule SDF cache files
  • Preserve MMFF/UFF energies so Boltzmann pooling still works from cached conformers
  • Added tests for cache hits, key isolation, corrupt-cache fallback, and energy-preserving reloads
  • Updated README and example usage

Impact

Users can avoid regenerating conformers across repeated runs by enabling the cache explicitly.

Validation

  • pixi run test: 18 passed, 1 skipped (jazzy not installed), 0 failures
  • Verified cache round-trip: cached conformers match fresh embed exactly
  • Verified cache survives monkeypatched embed() raising RuntimeError
  • Verified Boltzmann pooling works identically from cached and fresh conformers
  • Verified corrupt SDF cache silently falls back to fresh embed
  • Verified cache key changes when any embedding input (n_confs, seed, prune_rms, optimize) differs
  • Verified jagged-bag and NaN-row failure handling in batch APIs

Bug fix

  • Fixed jazzy test skip guard: was checking import casper.jazzy_properties (always succeeds), should check import jazzy directly — the dependency is imported lazily at runtime.

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