pino-source-code / scripts /cache_registry_embeddings.py
mattbitzesty's picture
feat(structure,thermo): 3D shape + natural oil reconstruction, 145-D input
05cb1f2 unverified
Raw
History Blame Contribute Delete
1.27 kB
from __future__ import annotations
import logging
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
from pino.registry import AromaRegistry
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
logger = logging.getLogger("cache_registry_features")
def main() -> None:
registry = AromaRegistry()
# Pass 1: populate single-molecule OpenPOM embeddings and 3D shape features.
logger.info("Pass 1: backfilling single-molecule features")
registry.backfill_openpom_embeddings()
registry.backfill_3d_shape_features()
# Pass 2: build weighted reconstructions for mapped natural oils.
logger.info("Pass 2: backfilling natural oil vectors")
registry.backfill_natural_oil_vectors()
# Spot-check a few representative entries.
for cas in ["5989-27-5", "NATURAL:8000-25-7", "NATURAL:8000-28-0"]:
record = registry.get(cas)
if record:
logger.info(
"Sample %s | openpom_len=%d | shape_len=%d",
cas,
len(record.get("openpom_embedding", [])),
len(record.get("shape_3d_features", [])),
)
registry.close()
if __name__ == "__main__":
main()