File size: 1,265 Bytes
05cb1f2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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()